Added a check to make sure player is close to object when utilizing it

This commit is contained in:
PrisonCamp
2014-11-23 09:04:50 -08:00
parent 96118f7d96
commit 8dc74fae2f
@@ -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;
}