From 7970be3656cec27c29c17b40bba74dd4e62e2d45 Mon Sep 17 00:00:00 2001 From: Seefo Date: Wed, 26 Mar 2014 22:02:19 -0400 Subject: [PATCH] Fixed #126, updated git ignore list --- .gitignore | 12 ++++++------ scripts/commands/setgodmode.py | 6 ++++++ src/resources/objects/creature/CreatureObject.java | 13 +++++++++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index ba829d14..1c5dcae9 100644 --- a/.gitignore +++ b/.gitignore @@ -50,12 +50,12 @@ interiorlayout/ clientdata/quest/ # PSWG Object Databases -odb/building/je.info.0.19 -odb/creature/je.info.0.19 -odb/doids/je.info.0.18 -odb/guild/je.info.0.19 -odb/mails/je.info.0.19 -odb/oids/je.info.0.19 +odb/building/je.info.* +odb/creature/je.info.* +odb/doids/je.info.* +odb/guild/je.info.* +odb/mails/je.info.* +odb/oids/je.info.* # External tool builders .externalToolBuilders/ diff --git a/scripts/commands/setgodmode.py b/scripts/commands/setgodmode.py index abb792da..bc6ef19c 100644 --- a/scripts/commands/setgodmode.py +++ b/scripts/commands/setgodmode.py @@ -78,6 +78,12 @@ def run(core, actor, target, commandString): elif command == 'instance' and arg1: core.instanceService.queue(arg1, actor) + elif command == 'action' and arg1: + actor.setAction(int(arg1)) + + elif command == 'health' and arg1: + actor.setHealth(int(arg1)) + elif command == 'id': actor.sendSystemMessage('Your id is: ' + str(actor.getObjectId()), 0) diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 501641b8..c2803448 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -1246,8 +1246,12 @@ public class CreatureObject extends TangibleObject implements IPersistent { IoBuffer delta; synchronized(objectMutex) { + if (this.health == health) return; if(health > maxHealth) - health = maxHealth; + { + setHealth(maxHealth); + return; + } setHamListCounter(getHamListCounter() + 1); delta = messageBuilder.buildHealthDelta(health); @@ -1264,10 +1268,15 @@ public class CreatureObject extends TangibleObject implements IPersistent { } public void setAction(int action) { + IoBuffer delta; synchronized(objectMutex) { + if (this.action == action) return; if(action > maxAction) - action = maxAction; + { + setAction(maxAction); + return; + } setHamListCounter(getHamListCounter() + 1); delta = messageBuilder.buildActionDelta(action); notifyObservers(delta, true);