Range checks for /inspire and /watch

This commit is contained in:
Waverunner
2014-03-16 13:42:19 -04:00
parent f14f656924
commit dfd68c11d6
2 changed files with 11 additions and 2 deletions
+5 -1
View File
@@ -28,7 +28,11 @@ def run(core, actor, target, commandString):
else:
actor.sendSystemMessage('@performance:insp_buff_must_listen', 2)
return
if target.getPosition().getDistance2D(actor.getWorldPosition()) > float(20):
actor.sendSystemMessage(target.getCustomName() + ' is too far away to inspire.')
return
builderWindow = BuffBuilderStartMessage(actor.getObjectId(), actor.getObjectId(), target.getObjectId())
objController = ObjControllerMessage(11, builderWindow)
actor.getClient().getSession().write(objController.serialize())
+6 -1
View File
@@ -11,7 +11,12 @@ def run(core, actor, target, commandString):
if target is None:
return
if target.getPosition().getDistance2D(actor.getWorldPosition()) > float(20):
actor.sendSystemMessage(target.getCustomName() + ' is too far away to watch.', 0)
return
if not target.isPlayer():
actor.sendSystemMessage('@performance:dance_watch_npc', 0)
return