Skip to content

Commit

Permalink
tr1/objects/bear: apply AI fix in bear control
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lahm86 committed Feb 27, 2025
1 parent 7e4ceb6 commit d5c73eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/tr1/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 2 additions & 5 deletions src/tr1/game/objects/creatures/bear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -76,6 +71,8 @@ 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) {
Expand Down

0 comments on commit d5c73eb

Please sign in to comment.