Familiars lose tame after player death
theboo opened this issue ยท 5 comments
Describe the bug
Summons seem to lose their tame after player death.
To Reproduce
Steps to reproduce the behavior:
1.summon a familiar(i tested with dragon and cthulu)
2.die
3.notice u cant make it sit and it no longer follows you/gives effects
Expected behavior
they should retain their tame status
System (please complete the following information):
- Occultism Version: 1.14.2 with no other mods outside dependencies
That's actually a nifty one - Vemerion added owner caching which we need for the familiar ring, but as a side effect the old player entity would be kept alive in memory and then compared to the respawned player.
Will switch that to a weak reference & check for player death to invalidate the cache, that should fix it.
Not sure if caching is worth it at all to be honest, since retrieving the owner via UUID should be constant time operation anyway. And also don't forget to change it for OtherworldBirdEntity as well, since that one does not inherit from FamiliarEntity! ๐
@vemerion good point about the bird, thanks!
I didn't do a lot of testing so I went the safe route and kept the cache .. but if it was only a performance consideration and not to cover some edge cases then I'll do away with it
Hmm, you might be right, if the player is in another level that the familiar, it probably can't be found unless the owner is cached.