diff --git a/CHANGELOG.md b/CHANGELOG.md index 222f33f0b..21e066dad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - fixed `/give` console command giving duplicate items under some circumstances (#1463, regression from 3.0) - fixed `/give` console command confusing logging around mismatched items (#1463, regression from 3.0) - fixed `/flip` console command misreporting an already enabled flipmap as off (regression from 4.0) +- fixed `/kill` console command not fully killing enemies (#1482, regression from 3.0) - fixed console commands causing improper ring shutdown with selected inventory item (#1460, regression from 3.0) - fixed console input immediately ending demo (#1480, regression from 4.1) - improved level load times diff --git a/src/game/console_cmd.c b/src/game/console_cmd.c index fe8ab4303..8449beccf 100644 --- a/src/game/console_cmd.c +++ b/src/game/console_cmd.c @@ -597,7 +597,7 @@ static COMMAND_RESULT Console_Cmd_Kill(const char *args) break; } - struct ITEM_INFO *item = &g_Items[best_item_num]; + ITEM_INFO *const item = &g_Items[best_item_num]; const int32_t distance = Item_GetDistance(item, &g_LaraItem->pos); found |= Lara_Cheat_KillEnemy(best_item_num); if (distance >= WALL_L) { diff --git a/src/game/lara/lara.c b/src/game/lara/lara.c index 82a0e684e..8195e729f 100644 --- a/src/game/lara/lara.c +++ b/src/game/lara/lara.c @@ -711,7 +711,7 @@ bool Lara_MovePosition(ITEM_INFO *item, XYZ_32 *vec) void Lara_Push(ITEM_INFO *item, COLL_INFO *coll, bool spaz_on, bool big_push) { - struct ITEM_INFO *lara_item = g_LaraItem; + ITEM_INFO *const lara_item = g_LaraItem; int32_t x = lara_item->pos.x - item->pos.x; int32_t z = lara_item->pos.z - item->pos.z; const int32_t c = Math_Cos(item->rot.y); diff --git a/src/game/lara/lara_cheat.c b/src/game/lara/lara_cheat.c index b790a2530..b4a5a3e5d 100644 --- a/src/game/lara/lara_cheat.c +++ b/src/game/lara/lara_cheat.c @@ -8,6 +8,7 @@ #include "game/inventory.h" #include "game/items.h" #include "game/lara.h" +#include "game/lot.h" #include "game/objects/common.h" #include "game/room.h" #include "game/sound.h" @@ -353,7 +354,7 @@ bool Lara_Cheat_OpenNearestDoor(void) bool Lara_Cheat_KillEnemy(const int16_t item_num) { - struct ITEM_INFO *item = &g_Items[item_num]; + ITEM_INFO *const item = &g_Items[item_num]; if (!Object_IsObjectType(item->object_number, g_EnemyObjects) || item->hit_points <= 0) { return false; @@ -362,6 +363,8 @@ bool Lara_Cheat_KillEnemy(const int16_t item_num) Effect_ExplodingDeath(item_num, -1, 0); Sound_Effect(SFX_EXPLOSION_CHEAT, &item->pos, SPM_NORMAL); Item_Kill(item_num); + LOT_DisableBaddieAI(item_num); + item->flags |= IF_ONESHOT; Carrier_TestItemDrops(item_num); return true; } diff --git a/src/global/types.h b/src/global/types.h index 4e875358e..53291bfe1 100644 --- a/src/global/types.h +++ b/src/global/types.h @@ -1280,7 +1280,7 @@ typedef struct CARRIED_ITEM { struct CARRIED_ITEM *next_item; } CARRIED_ITEM; -typedef struct ITEM_INFO { +typedef struct { int32_t floor; uint32_t touch_bits; uint32_t mesh_bits;