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

Correct coordinate handling for active item cache #32376

Merged
merged 1 commit into from Jul 15, 2019

Conversation

kevingranade
Copy link
Member

@kevingranade kevingranade commented Jul 14, 2019

SUMMARY: None

Purpose of change

Fixes #32341
Fixes #32133
These are both due to bugs in coordinate handling for submaps_with_active_items.

Describe the solution

Fix coordinate handling.

Testing

Underground item processing is unreliable because the previous code adds or subtracts map::abs_sub::z from the local submap coordinates. To test go underground or aboveground and fling smoke bombs (safer than grenades).
To test pulping, just spawn a zombie and a NPC and kill the zombie, be sre to check underground too.

This was using abs_sub inapropriately to convert between absolute and local coordinates.
Only x and y coordinates need conversion, z does not.
Also map::get_active_items_in_radius() was failing to convert entirely.
@kevingranade kevingranade changed the title Correct get_active_items_in_radius Correct coordinate handling for active item cache Jul 14, 2019
@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` NPC / Factions NPCs, AI, Speech, Factions, Ownership labels Jul 14, 2019
@ZhilkinSerg ZhilkinSerg merged commit fba3874 into CleverRaven:master Jul 15, 2019
@kevingranade kevingranade added this to Done in Perf Rush Jul 27, 2019
@kevingranade kevingranade deleted the fix-active-item-cache branch December 16, 2019 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
No open projects
Perf Rush
  
Done
Development

Successfully merging this pull request may close these issues.

Post update NPCs not pulping corspes. Grenades aren't detonating in some lab rooms
2 participants