Fix for faction creation sometimes causing an NPE; hopefully a fix for the cause of the null value as well, from an ID clash in the entity collection of factions
Fix for disband command causing an NPE if run from the console Additionally, disband command use is now logged
This commit is contained in:
1 parent
cace4aa955
commit
4ec086e4fa
4 files changed
+18
-5
No files matched your search
@@ -217,8 +217,13 @@ public abstract class EntityCollection<E extends Entity>
|
||||
|
||||
public String getNextId()
|
||||
{
|
||||
this.nextId += 1;
|
||||
return "" + (nextId - 1);
|
||||
String next = Integer.toString(this.nextId);
|
||||
do
|
||||
{
|
||||
this.nextId += 1;
|
||||
} while ( ! isIdFree(Integer.toString(this.nextId)) );
|
||||
|
||||
return next;
|
||||
}
|
||||
|
||||
public boolean isIdFree(String id)
|
||||
|
||||
Reference in new issue
Block a user