From 0de494c2e0ee73e76d28fac475030f4be49c9838 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 29 May 2022 18:44:59 +0000 Subject: [PATCH] Make thief explode when killed Commit 1a9fba804d21 made an incorrect simplification. It observed that thief robots are not boss robots and vice versa, and from that changed: ``` if (is_thief) { drop_stolen_items(); } if (is_boss) { start_boss_death_sequence(); } else if (death_roll) { start_robot_death_sequence(); } else { regular_death(); } ``` to ``` if (is_thief) { drop_stolen_items(); } else if (is_boss) { start_boss_death_sequence(); } else if (death_roll) { start_robot_death_sequence(); } else { regular_death(); } ``` This was incorrect, because although a thief is not a boss, a thief does need to proceed through the other non-boss if tests. This error caused a thief not to explode on death, and instead continue to fly around and absorb weapon fire. Fix the logic error by removing the incorrect `else`, so that a thief can be tested for is_boss, get false, and then proceed through the non-boss death logic. Fixes: 1a9fba804d21dcf5f67562500ba3134ac91b9466 ("Avoid repeated valptridx dereferences in multibot.cpp") --- similar/main/multibot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/similar/main/multibot.cpp b/similar/main/multibot.cpp index 5d14782af..bee874742 100644 --- a/similar/main/multibot.cpp +++ b/similar/main/multibot.cpp @@ -965,7 +965,7 @@ int multi_explode_robot_sub(const vmobjptridx_t robot) const auto robot_id = get_robot_id(objrobot); if (robot_is_thief(Robot_info[robot_id])) drop_stolen_items(vmsegptridx, LevelUniqueObjectState, Vclip, robot); - else if (Robot_info[robot_id].boss_flag) + if (Robot_info[robot_id].boss_flag) { if (!BossUniqueState.Boss_dying) start_boss_death_sequence(LevelUniqueObjectState.BossState, LevelSharedRobotInfoState.Robot_info, robot);