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

Fix: throwing items from outside the inventory #73987

Merged
merged 1 commit into from
May 22, 2024

Conversation

Brambor
Copy link
Contributor

@Brambor Brambor commented May 21, 2024

Summary

None

Purpose of change

See this comment: #73498 (comment)

Describe the solution

Call the right method.

Describe alternatives you've considered

Testing

This should be tested, if the problem existed and now it doesn't exist. I didn't test it but I would expect the test to go like this:

  1. spawn NPC
  2. spawn items 5 tiles from it
  3. make it want to throw items
  4. BUG: npc throws item that is 5 tiles from it at the target

I didn't test it because I don't know how to make step 3.

Additional context

Even if this doesn't fix anything, it at least fixes the warning in Microsoft Visual Studio.

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels May 21, 2024
Copy link
Member

@RenechCDDA RenechCDDA left a comment

Choose a reason for hiding this comment

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

I expected the compiler to select the overload which matched types, but apparently it preferred implicitly converting(?!) to selecting an overload. Making sure we use the correct function definition is important, and this does that. So here's my 👍

@RenechCDDA
Copy link
Member

BUG: npc throws item that is 5 tiles from it at the target

(Preface: I also did not test this 😆)

I don't think this is correct. That's just for evaluation purposes- it's still running the same attack decisions. That just returns 0 'considered attack effectiveness' when certain conditions (no other good weapons) is met. At worst it would mean they throw weapons when they shouldn't because they might consider a weapon on the ground as being available.

@dseguin dseguin merged commit 50164ff into CleverRaven:master May 22, 2024
29 of 31 checks passed
@Brambor Brambor deleted the char-throw-fix branch May 22, 2024 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants