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

Possible fix for Imps not searching for space in Treasure Room #3649

Merged
merged 4 commits into from
Nov 9, 2024

Conversation

AdamPlenty
Copy link
Contributor

Possibly fixes #3642

@@ -1285,17 +1285,17 @@ short imp_drops_gold(struct Thing *spdigtng)
if (is_thing_directly_controlled_by_player(spdigtng, my_player_number))
{
play_non_3d_sample(119);
internal_set_thing_state(spdigtng, state);
Copy link
Member

Choose a reason for hiding this comment

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

Why would we set a state to a creature when it is possessed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To keep it under possession, if I recall correctly.

Copy link
Member

Choose a reason for hiding this comment

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

This does not sound correct to me. Possession overwrites states, the states are used to direct creature behavior.
I think it was there (but outside of this if) to get imps to get back to mining when they fail to drop off gold anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I may need to test again, but if I remember correctly, if the Imp is under possession, he'll do his own thing even though he's under possession, unless his state is reset. We do not want possessed Imps to be set to the last work state.

Copy link
Member

Choose a reason for hiding this comment

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

But you are setting possessed imps to last_work_state here right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. Possessed Imps are set to the null state.

@Loobinex Loobinex marked this pull request as draft November 7, 2024 19:15
@Loobinex Loobinex marked this pull request as ready for review November 7, 2024 19:15
@AdamPlenty AdamPlenty changed the title Possible fix for Imps not searching for gold hoards Possible fix for Imps not searching for space in Treasure Room Nov 8, 2024
@Loobinex
Copy link
Member

Loobinex commented Nov 9, 2024

@AdamPlenty I tested it and found bugs:

  1. I possessed an imp and mined gold in possession. It would not drop the gold at his feet when i mined beyond the limit.
  2. I exited possession then dropped the imp into an empty treasure room, and it would be stuck and not move at all.

@AdamPlenty
Copy link
Contributor Author

@AdamPlenty I tested it and found bugs:

1. I possessed an imp and mined gold in possession. It would not drop the gold at his feet when i mined beyond the limit.

2. I exited possession then dropped the imp into an empty treasure room, and it would be stuck and not move at all.

I am unable to reproduce either bug.

@Loobinex
Copy link
Member

Loobinex commented Nov 9, 2024

I am unable to reproduce either bug.

Sorry, my fault. Tested it incorrectly.

@Loobinex Loobinex merged commit f88db4a into dkfans:master Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Imp do not fully empty their pockets in the Treasure Room
2 participants