[Bug Fix] Fix Corpses "Disappearing" (#4275)

This fixes corpses "disappearing" by fixing the graveyard check. Prior to the corpse overhaul (#3938), moving corpses to graveyards was assumed successful and automatically removed from the process.

Note: Will open a separate issue for the graveyard timer handling.

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

# Testing

Attach images and describe testing done to validate functionality.

Clients tested: RoF2

# Checklist

- [x] I have tested my changes
- [x] I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
- [x] I own the changes of my code and take responsibility for the potential issues that occur
This commit is contained in:
JJ 2024-04-20 20:56:58 -04:00 committed by GitHub
parent 5a6e0c9e3d
commit a565e5f824
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -991,9 +991,11 @@ bool Corpse::Process()
}
if (m_corpse_graveyard_timer.Check()) {
MovePlayerCorpseToGraveyard();
m_corpse_graveyard_timer.Disable();
return false;
if (MovePlayerCorpseToGraveyard()) {
m_corpse_graveyard_timer.Disable();
return false;
}
return true; // If the corpse was not moved, continue the corpse in the process rather than put in limbo
}
// Player is offline. If rez timer is enabled, disable it and save corpse.