SuperSimpleGuy / dytenjin

An engine for making dynamic text-based java games.
GNU General Public License v3.0
1 stars 0 forks source link

Change IdentityManager getNextFreeId() #15

Closed SuperSimpleGuy closed 11 years ago

SuperSimpleGuy commented 11 years ago

Should be:

public int getNextFreeId(String key) {
    if (!identities.containsKey(key)) {
        return 0; //This shouldn't be -1, as zero is technically the next free id.
    }
    int temp = identities.get(key);
    identities.put(key, temp + 1);
    return temp;
}