Issue Data
|
Issue #26817: 001A6968: Knife held by corpse remains when corpse is purged |
The corpse and the knife have a DefaultDisableHavokOnLoad script and they are properly linked as havok partners, i.e. the knife would fall down when the corpse was activated by the player. Cases such as this one where the havok partner may get cleaned up by the engine eventually, cannot handled by DefaultDisableHavokOnLoad though. I modified the script to check whether the linked ref is disabled, deleted or no longer existing at all, and to release the reference it's running on to havok in these cases. There's one small problem though: the script doesn't know whether there is a linked ref or not and it does also not record whether it has one (i.e. there's no property to tell it), simply because it doesn't matter: if it finds a linked ref, it runs some stuff on it and otherwise, it doesn't. Though, the specific check I added makes no sense if there is no linked ref, and it would also not work without one - because, if the linked ref is 'none', we would not know whether it has disappeared or whether there never was one. To handle this, I added a bool property which is false by default. Thus, all refs with this script will have this bool set to false now when they update to the new script and they will skip that new check. The bool should be set to true only on the refs that need the extra check (such as this knife). By setting it to true, I guarantee, so to say, that the ref is one of the rare cases where this extra check is required, and that all prerequisites for running that check successfully are fulfilled, i.e. that there was a linked ref existing at the start of the game.
Fixed for 001A6968. There was at least one other place with a knife on a body that would get culled eventually and left the knife floating, but I don't remember where,
Showing Comments 1 - 2 of 2