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:
@ -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