Skip to content

Draft: Fix Lua Move functions breaking mobj references

Hanicef requested to merge Hanicef/SRB2:fix-move-mobj-reference into next

In Lua scripts, functions that moved mobjs also updated object references using a local variable. This caused a dangling pointer to be considered a valid reference, which threw off the reference counter and caused it to report bogus values (console was flooded with Number of potentially faulty references: -1073741825 errors, which doesn't make any sense). This most notably caused memory leaks, as unused mobjs would no longer deallocated, but it could potentially cause further issues down the line, such as alive object being reported as dead (this is not confirmed though).

Edited by Hanicef

Merge request reports

Loading