fixed #337 and removed some lock contention

This commit is contained in:
Light2
2014-03-31 01:18:52 +02:00
parent ba3b423ea6
commit dc03c31276
4 changed files with 22 additions and 16 deletions
+10 -1
View File
@@ -23,6 +23,8 @@ def run(core, actor, target, commandString):
arg3 = commandArgs[3]
if len(commandArgs) > 4:
arg4 = commandArgs[4]
if len(commandArgs) > 5:
arg5 = commandArgs[5]
if not command:
return
@@ -41,7 +43,14 @@ def run(core, actor, target, commandString):
elif command == 'teleport' and arg2 and arg3 and arg4:
position = Point3D(float(arg2), float(arg3), float(arg4))
core.simulationService.transferToPlanet(actor, core.terrainService.getPlanetByName(arg1), position, actor.getOrientation(), None)
elif command == 'teleportplayer' and arg1 and arg2 and arg3 and arg4 and arg5:
player = core.chatService.getObjectByFirstName(arg1)
if player:
position = Point3D(float(arg3), float(arg4), float(arg5))
core.simulationService.transferToPlanet(player, core.terrainService.getPlanetByName(arg2), position, player.getOrientation(), None)
elif command == 'credits' and arg1:
actor.setCashCredits(actor.getCashCredits() + int(arg1))
actor.sendSystemMessage('The Galactic Empire has transferred ' + arg1 + ' credits to you for your service.', 0)
+1 -1
View File
@@ -13,7 +13,7 @@ def run(core, actor, target, commandString):
return
if target.getPosition().getDistance2D(actor.getWorldPosition()) > float(20):
if target.getWorldPosition().getDistance2D(actor.getWorldPosition()) > float(20):
actor.sendSystemMessage(target.getCustomName() + ' is too far away to watch.', 0)
return