This will also happen if killing an entity and leaving it offscreen, before the death state reaches the point where the corpse prefab replacement would be checked for (or the usual eroding process occurs).
This happens because the eroding process is fully prevented if the entity is able to leave a corpse at all, regardless if actual conditions that would it to happen at all.
function Health:CanFadeOut() -- Intentional lack of IsValid(). return not self.nofadeout and not EntityHasCorpse(self.inst) end -- from Health:SetVal if self:CanFadeOut() then self.inst:AddTag("NOCLICK") self.inst.persists = false self.inst.erode_task = self.inst:DoTaskInTime(self.destroytime or 2, ErodeAway) end
The EntityHasCorpse check could be changed to self.is_corpsing, which is set just before the CanFadeOut call. But this might need to be a bit more intricate than that?
Maybe force stategraphs to update for these very specific cases with death state? Or have an alternate task handle it for these cases, using common functionality. Unsure.
This can be reproduced with the Merm King starving to death and dying.
As long as he's left offscreen, he will never actually fully die, allowing all related buffs to still apply (the game checks for the Merm King being removed to disable the buffs, not dying).
You can then test saving and loading the game to see the entity persisting (I haven't tested this, but I assume it'll work as you'd expect), and the entity in the middle of the death state will keep persisting.
It can also easily be tested by debug selecting an offscreen entity that can leave a corpse, killing it, and checking that it will persist until it's no longer offscreen. Compare this with an entity that can't leave behind a corpse, and you'll notice it will work as it used to, with it eroding away even while offscreen.
-
1
A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now