Commit 76fc27b9 authored by Samuel Wegner's avatar Samuel Wegner Committed by DarkGod
Browse files

Fix some issues with Warden's Call

Fix 1: Improve cloning function

Previously, makeParadoxClone() temporarily cleared the actor's
particles and main inventory so that they wouldn't be copied by
cloneFull() when making Warden's Call clones. However, this resulted
in some players losing their inventory, probably due to some race
condition during lag caused by the Warden's Call memory leak.

Now, makeParadoxClone() has its own recursive table cloning function
with options for skipping specific nodes or assigning them a different
value from the source table. This way, we can clone an actor without
modifying that actor's table.

Fix 2: Create cleanup function for Warden's Call

Added a basic cleanup function for Warden's Call clones. Currently, it
just makes sure they're dead and replaces references in timed effects
with references to the player, so the clones can be freed by the
garbage collector. More features will likely be added as I find other
causes of the memory leak.

NOTE: These changes don't fix the memory leak. It may help a little,
but that issue needs more investigation.

It's probably worth pushing these changes back to v1.3.X in a minor
update to fix the issue with missing player inventory. Completely
fixing the memory leak may take a while.
parent 2eecf6a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment