From 5ec38d9bf8eabfab8fd1788475db5126b20d5dae Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Thu, 27 Feb 2025 20:48:18 +0000 Subject: [PATCH] tr1/objects/bear: apply AI fix in bear control This moves the bear AI fix to the control routine to avoid the setting having been changed before demos load, where the setting will be disabled. Resolves #2559. --- docs/tr1/CHANGELOG.md | 1 + src/tr1/game/objects/creatures/bear.c | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/tr1/CHANGELOG.md b/docs/tr1/CHANGELOG.md index 640be22aa..77dc42a39 100644 --- a/docs/tr1/CHANGELOG.md +++ b/docs/tr1/CHANGELOG.md @@ -1,6 +1,7 @@ ## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr1-4.8.3...develop) - ××××-××-×× - added support for custom levels to use `disable_floor` in the gameflow, similar to TR2's Floating Islands (#2541) - changed the Controls screen to hide the reset and unbind texts when changing a key (#2103) +- fixed the bear AI fix option being applied in the Vilcabamba demo (#2559, regression from 4.8) ## [4.8.3](https://github.com/LostArtefacts/TRX/compare/tr1-4.8.2...tr1-4.8.3) - 2025-02-17 - fixed some of Lara's speech in the gym not playing in response to player action (#2514, regression from 4.8) diff --git a/src/tr1/game/objects/creatures/bear.c b/src/tr1/game/objects/creatures/bear.c index af0a14361..54ad61a2c 100644 --- a/src/tr1/game/objects/creatures/bear.c +++ b/src/tr1/game/objects/creatures/bear.c @@ -58,11 +58,6 @@ static void M_Setup(OBJECT *const obj) obj->collision_func = Creature_Collision; obj->shadow_size = UNIT_SHADOW / 2; obj->hit_points = BEAR_HITPOINTS; - if (g_Config.gameplay.fix_bear_ai) { - obj->pivot_length = 0; - } else { - obj->pivot_length = 500; - } obj->radius = BEAR_RADIUS; obj->smartness = BEAR_SMARTNESS; obj->intelligent = 1; @@ -76,6 +71,7 @@ static void M_Setup(OBJECT *const obj) static void M_Control(const int16_t item_num) { + Object_Get(O_BEAR)->pivot_length = g_Config.gameplay.fix_bear_ai ? 0 : 500; ITEM *const item = Item_Get(item_num); if (item->status == IS_INVISIBLE) {