Cache and reuse removed mobjs when spawning mobjs - Take 2 #144

Merged
alufolie91 merged 12 commits from mobjcache2 into Saturn-Next 2024-12-02 21:31:25 +01:00
alufolie91 commented 2024-11-26 19:22:06 +01:00 (Migrated from github.com)

basically https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2200

but without the crashing

Turns out, polyobject stuff has its own way of adding thinkers into the thinkerlist and hence thinker->cachable was never initialised since i didnt notice it before , and due to the ambigous check for thinker->cachable, non mobj thinkers were added into the mobjcache

This one has a more explicit check and also proper initialises stuff in PolyObj_AddThinker

basically https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2200 but without the crashing Turns out, polyobject stuff has its own way of adding thinkers into the thinkerlist and hence thinker->cachable was never initialised since i didnt notice it before , and due to the ambigous check for thinker->cachable, non mobj thinkers were added into the mobjcache This one has a more explicit check and also proper initialises stuff in PolyObj_AddThinker
alufolie91 commented 2024-11-26 19:31:31 +01:00 (Migrated from github.com)

technically, PolyObj_AddThinker doesent init thinker->references at all, which does lead to their thinkers being unable to removed most of the time (P_RemoveThinkerDelayed checks if the references are 0 before freeing thinkers) so imho it should also be init there. however knowing this game, that might cause issues in netgames or smth? so no clue, ill just leave it for now

technically, PolyObj_AddThinker doesent init thinker->references at all, which does lead to their thinkers being unable to removed most of the time (P_RemoveThinkerDelayed checks if the references are 0 before freeing thinkers) so imho it should also be init there. however knowing this game, that might cause issues in netgames or smth? so no clue, ill just leave it for now
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: saturn/SRB2Kart-Saturn#144