-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Map item processing refactoring #39942
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifreund
added
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
labels
Apr 26, 2020
probably conflicts with #39406 |
You haven't made any edits in these areas at least yet. |
ifreund
approved these changes
Apr 26, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh good, i was worried it would cause a merge conflict like the last one. i only skimmed it, i didn't try to review it. |
Drewscriver
pushed a commit
to Drewscriver/Cataclysm-DDA
that referenced
this pull request
Apr 30, 2020
* remove processor * remove map_process_func * remove signal and gridz * unused boolean in process_items * removed process_items * removed process_active_items instead of process_items * made process_items public * astyle * activate is always false here * remove process_item * astyle
This was referenced May 3, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "Map item processing refactoring"
Purpose of change
The chain of functions for processing items on map is weird and hard to follow.
There are also many things that are in there but do not do anything.
Describe the solution
processor
pointer to a function. The function is always the sameprocess_map_items
so this was pointless. Now they just call the function.signal
.gridz
.process_items
is always true and was only used in an or statement where it did nothing. Removed the boolean.process_active_items
did was set the above unneeded boolean to true and then callprocess_items
. Removedprocess_active_items
and instead just callprocess_items
.process_items
was made public so it can be called.process_item
always passes along a boolean false. Just have false in the final palce.process_map_items
does nothing but callprocess_item
. Replaceprocess_item
withprocess_map_items
.Describe alternatives you've considered
Let it stay as unreadable mess of functions calling other functions calling other functions without clearly stating what function is called while passing variables that do nothing.
Testing
Tests pass, items still get processed in inventory, on ground and in vehicles.
Additional context
There should be zero visible changes in gameplay.