v0.6.2: enemy spawner now only counts hostile mobs for the total

This commit is contained in:
Evan Debenham 2017-09-12 22:59:33 -04:00
parent 30e021f8d5
commit 66765800cf

View File

@ -503,7 +503,12 @@ public abstract class Level implements Bundlable {
@Override
protected boolean act() {
if (mobs.size() < nMobs()) {
int count = 0;
for (Mob mob : mobs.toArray(new Mob[0])){
if (mob.hostile) count++;
}
if (count < nMobs()) {
Mob mob = createMob();
mob.state = mob.WANDERING;