mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
Added a check to make sure player is close to object when utilizing it
This commit is contained in:
@@ -108,12 +108,30 @@ messageHandler handleReactivateCore()
|
||||
|
||||
trigger OnObjectMenuRequest(obj_id player, menu_info item)
|
||||
{
|
||||
location here = getLocation (player);
|
||||
location term = getLocation (self);
|
||||
float range = getDistance(here, term);
|
||||
if (range > 2.0)
|
||||
{
|
||||
sendSystemMessage (player, new string_id ( SYSTEM_MESSAGES, "elev_range" ) );
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
|
||||
checkForReactorShutDown( self, player );
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
trigger OnOpenedContainer( obj_id player )
|
||||
{
|
||||
location here = getLocation (player);
|
||||
location term = getLocation (self);
|
||||
float range = getDistance(here, term);
|
||||
if (range > 2.0)
|
||||
{
|
||||
sendSystemMessage (player, new string_id ( SYSTEM_MESSAGES, "elev_range" ) );
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
|
||||
checkForReactorShutDown( self, player );
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user