Skip to content

Commit be796b2

Browse files
committed
correct GroupAddUnit return value, fixes #1009
1 parent 5e4a008 commit be796b2

File tree

1 file changed

+3
-0
lines changed
  • de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/jassinterpreter/providers

1 file changed

+3
-0
lines changed

de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/jassinterpreter/providers/GroupProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public void GroupClear(IlConstHandle group) {
2626

2727
public ILconstBool GroupAddUnit(IlConstHandle group, IlConstHandle unit) {
2828
LinkedHashSet<IlConstHandle> groupList = (LinkedHashSet<IlConstHandle>) group.getObj();
29+
if (groupList.contains(unit)) {
30+
return ILconstBool.FALSE;
31+
}
2932
groupList.add(unit);
3033
return ILconstBool.TRUE;
3134
}

0 commit comments

Comments
 (0)