Skip to content

Commit

Permalink
Fix location clone bug in entity's cursor_on attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Mastaba authored and Mastaba committed Nov 12, 2013
1 parent c4a8ae0 commit fa4a853
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ else if (attribute.startsWith("equipment")) {
if (attribute.startsWith("location.cursor_on")) {
int range = attribute.getIntContext(2);
if (range < 1) range = 50;
return new dLocation(getLivingEntity().getTargetBlock(null, range).getLocation())
return new dLocation(getLivingEntity().getTargetBlock(null, range).getLocation().clone())
.getAttribute(attribute.fulfill(2));
}

Expand All @@ -1261,7 +1261,7 @@ else if (attribute.startsWith("equipment")) {
// Returns the location of what the entity is standing on.
// -->
if (attribute.startsWith("location.standing_on"))
return new dLocation(entity.getLocation().add(0, -1, 0))
return new dLocation(entity.getLocation().clone().add(0, -1, 0))
.getAttribute(attribute.fulfill(2));

// <--[tag]
Expand Down

0 comments on commit fa4a853

Please sign in to comment.