Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tr1/objects/bear: apply AI fix in bear control #2562

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Feb 27, 2025

Resolves #2559.

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change
  • I have added a readme entry about my new feature or OG bug fix, or it is a different change

Description

This moves the bear AI fix to the control routine as otherwise when the demo alters the setting, its effect has already taken place in the bear setup function. It's not ideal calling it on every frame a bear is active, but I suppose a benefit is that it does allow changing the setting in-game with the console without having to reload.

@lahm86 lahm86 added TRX bug A bug with TRX TR1 labels Feb 27, 2025
@lahm86 lahm86 self-assigned this Feb 27, 2025
@lahm86 lahm86 requested review from a team as code owners February 27, 2025 20:51
@lahm86 lahm86 requested review from rr-, walkawayy and aredfan and removed request for a team February 27, 2025 20:51
Copy link

github-actions bot commented Feb 27, 2025

@lahm86 lahm86 force-pushed the issue-2559-fix-demo-bear-ai branch from d5c73eb to 5ec38d9 Compare February 27, 2025 20:53
@lahm86 lahm86 force-pushed the issue-2559-fix-demo-bear-ai branch from 5ec38d9 to bc5067b Compare February 27, 2025 20:59
@@ -76,6 +71,8 @@ static void M_Setup(OBJECT *const obj)

static void M_Control(const int16_t item_num)
{
OBJECT *const obj = Object_Get(O_BEAR);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last nitpick - can we use item->object_id?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, my bad. I was a bit hasty with this 😄

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 LostArtefacts#2559.
@lahm86 lahm86 force-pushed the issue-2559-fix-demo-bear-ai branch from bc5067b to 0298b08 Compare February 27, 2025 21:14
Copy link
Collaborator

@aredfan aredfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and thank you. 👍

@lahm86 lahm86 merged commit 90a9e82 into LostArtefacts:develop Feb 27, 2025
8 checks passed
@lahm86 lahm86 deleted the issue-2559-fix-demo-bear-ai branch February 27, 2025 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TR1 TRX bug A bug with TRX
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

TR1X bug: fix bear ai is affecting demos
3 participants