Fixed dead characters respawning at the site would retain inventory items#28
Open
yahvk-cuna wants to merge 2 commits into
Open
Fixed dead characters respawning at the site would retain inventory items#28yahvk-cuna wants to merge 2 commits into
yahvk-cuna wants to merge 2 commits into
Conversation
Collaborator
|
Does this properly fix the problem? By looking into the documentation it appears like StartItemsGiven is more or less a flag that is set whenever a character has properly spawned in; and is retained in the xml. I would feel abit more secure if inventory-/ and hpData were null-checked before assigned (or at the very least set to some default) to the character (which is mainly what the original code-block was attempting to do) The proper fix might be to grab a default-spawn item-package and assign it if the loaded inventory and hp information are null |
Author
|
Sorry that I forgot about this PR. In , it flags dead people with StartItemsGiven false, so the if condition is met when the character is respawning. Setting the inventory to null and StartItemsGiven to false is the correct way to indicate this character is respawning and will lead the game to give job items in https://github.com/FakeFishGames/Barotrauma/blob/47badaf760c216d5bb807fd26de87b7e284683bb/Barotrauma/BarotraumaShared/SharedSource/GameSession/CrewManager.cs#L291-L301.I have been running my campaigns with this change. I haven't had any problems related to this in the past few months. |
AntoineDijoux
added a commit
to AntoineDijoux/multiplayer-crew-manager
that referenced
this pull request
May 20, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When respawn is on, dead characters who respawn at the site will retain inventory items, causing the character's inventory to be copied.