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

This commit is contained in:
Redacted by Stellabellum INC
2014-11-23 08:56:44 -08:00
parent a52a5ded5e
commit 8d5ce60d1e
@@ -12,6 +12,15 @@ trigger OnInitialize()
trigger OnObjectMenuRequest(obj_id player, menu_info mi)
{
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_CONTINUE;
}
sui.msgbox(player, new string_id ( SYSTEM_MESSAGES, "bio_terminal" ));
return SCRIPT_OVERRIDE;
}