Fixed system to use the BattleEngine result.
This commit is contained in:
parent
bf8a2dc0c5
commit
43435509f6
1 changed files with 2 additions and 2 deletions
|
@ -231,7 +231,7 @@ void System::combat(GameLevel &level, int attack_id) {
|
|||
}
|
||||
|
||||
while(auto act = battle.next()) {
|
||||
auto [enemy, action] = *act;
|
||||
auto [enemy, enemy_action] = *act;
|
||||
|
||||
Events::Combat result {
|
||||
player_combat.attack(enemy.combat), 0
|
||||
|
@ -242,7 +242,7 @@ void System::combat(GameLevel &level, int attack_id) {
|
|||
world.set<SpriteEffect>(enemy.entity, {100, effect});
|
||||
}
|
||||
|
||||
if(enemy.ai.wants_to("kill_enemy")) {
|
||||
if(enemy_action == combat::BattleAction::ATTACK) {
|
||||
result.enemy_did = enemy.combat.attack(player_combat);
|
||||
animate_entity(world, enemy.entity);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue