diff --git a/src/main/java/com/denizenscript/denizencore/objects/core/ListTag.java b/src/main/java/com/denizenscript/denizencore/objects/core/ListTag.java index 62edb518..feaf9177 100644 --- a/src/main/java/com/denizenscript/denizencore/objects/core/ListTag.java +++ b/src/main/java/com/denizenscript/denizencore/objects/core/ListTag.java @@ -996,7 +996,7 @@ else if (input.size() > 1) { ListTag items = getListFor(attribute.getContextObject(1), attribute.context); if (attribute.startsWith("at", 2) && attribute.hasContext(2)) { ListTag result = new ListTag(object); - int index = attribute.getIntContext(2) - 1; + int index = object.parseIndex(attribute.getContext(2)); if (index < 0) { index = 0; } @@ -1032,7 +1032,7 @@ else if (input.size() > 1) { ListTag items = getListFor(attribute.getContextObject(1), attribute.context); if (attribute.startsWith("at", 2) && attribute.hasContext(2)) { ListTag result = new ListTag(object); - int index = attribute.getIntContext(2) - 1; + int index = object.parseIndex(attribute.getContext(2)); if (index > result.size() - 1) { index = result.size() - 1; } @@ -1069,7 +1069,7 @@ else if (input.size() > 1) { ObjectTag value = attribute.getContextObject(1); if (attribute.startsWith("at", 2) && attribute.hasContext(2)) { ListTag result = new ListTag(object); - int index = attribute.getIntContext(2) - 1; + int index = object.parseIndex(attribute.getContext(2)); if (index > result.size() - 1) { index = result.size() - 1; } @@ -1109,7 +1109,7 @@ else if (input.size() > 1) { ListTag items = getListFor(attribute.getContextObject(1), attribute.context); if (attribute.startsWith("at", 2) && attribute.hasContext(2)) { ListTag result = new ListTag(object); - int index = attribute.getIntContext(2) - 1; + int index = object.parseIndex(attribute.getContext(2)); if (index < 0) { index = 0; }