Updated hasThreats logic.
This commit is contained in:
parent
c7af23e55f
commit
4aec10e614
|
@ -53,6 +53,8 @@ void initBattle(void)
|
|||
app.delegate.draw = &draw;
|
||||
memset(&app.keyboard, 0, sizeof(int) * MAX_KEYBOARD_KEYS);
|
||||
|
||||
battle.hasThreats = 1;
|
||||
|
||||
initQuadtree(&battle.quadtree);
|
||||
|
||||
initBullets();
|
||||
|
|
|
@ -217,14 +217,14 @@ void doEntities(void)
|
|||
{
|
||||
numSpawnedEnemies++;
|
||||
}
|
||||
}
|
||||
|
||||
if (e->health > 0 && !(e->flags & EF_DISABLED))
|
||||
if (!(e->flags & EF_DISABLED))
|
||||
{
|
||||
battle.hasThreats = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prev = e;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,17 @@ void doObjectives(void)
|
|||
{
|
||||
battle.numConditions++;
|
||||
}
|
||||
|
||||
if (o->isEliminateAll && o->status != OS_COMPLETE && !battle.hasThreats)
|
||||
{
|
||||
addHudMessage(colors.green, _("%s - Objective Complete!"), o->description);
|
||||
|
||||
o->currentValue = o->targetValue;
|
||||
|
||||
o->status = OS_COMPLETE;
|
||||
|
||||
runScriptFunction("OBJECTIVES_COMPLETE %d", battle.numObjectivesComplete + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -119,17 +130,6 @@ void updateObjective(char *name, int type)
|
|||
runScriptFunction("OBJECTIVES_COMPLETE %d", ++completed);
|
||||
}
|
||||
}
|
||||
|
||||
if (o->isEliminateAll && o->status != OS_COMPLETE && !battle.hasThreats)
|
||||
{
|
||||
addHudMessage(colors.green, _("%s - Objective Complete!"), o->description);
|
||||
|
||||
o->currentValue = o->targetValue;
|
||||
|
||||
o->status = OS_COMPLETE;
|
||||
|
||||
runScriptFunction("OBJECTIVES_COMPLETE %d", ++completed);
|
||||
}
|
||||
}
|
||||
|
||||
if (!o->active)
|
||||
|
|
Loading…
Reference in New Issue