Skip to content

Commit

Permalink
Fix heal command error with decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 17, 2013
1 parent b464bd6 commit ea0650f
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -45,7 +45,7 @@ else if (!scriptEntry.hasObject("entities")
}

if (!scriptEntry.hasObject("amount"))
scriptEntry.addObject("amount", new Element(Integer.MAX_VALUE));
scriptEntry.addObject("amount", new Element(-1));

if (!scriptEntry.hasObject("entities")) {
List<dEntity> entities = new ArrayList<dEntity>();
Expand All @@ -68,7 +68,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
Element amountelement = scriptEntry.getElement("amount");

dB.report(getName(), amountelement.debug() + aH.debugObj("entities", entities));
if (amountelement.asInt() == Integer.MAX_VALUE)
if (amountelement.asDouble() == -1)
for (dEntity entity : entities)
entity.getLivingEntity().setHealth(entity.getLivingEntity().getMaxHealth());
else {
Expand Down

0 comments on commit ea0650f

Please sign in to comment.