forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix distributing food with empties containers (CleverRaven#41232)
* Fix distributing food in faction camps: Multiple things in one commit because this is basically a complete rewrite of the existing code. The existing code doesn't handle food in containers correctly. It gets a list of pointers to the items within a container, and clears the content of that container. Now those pointers are all dangling, but they are used nonetheless. That'll cause UB. Empty containers were dropped on a special tile, with **global** coordinates (omt_pos is global). This has been fixed, but it will still teleport items randomly without any sense. Code was restructured by using lambdas to create separate parts. * Remove feature of littering food containers from distributing base camp food Instead just keep the container where it is.
- Loading branch information
Showing
1 changed file
with
80 additions
and
53 deletions.
There are no files selected for viewing
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