Commit graph

9 commits

Author SHA1 Message Date
Isaac0-dev
5303357146
fix custom level data memory leak (#1256)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
this fixes the giant memory leak that happens due to not freeing custom level data when closing a lobby.
`DynOS_Lvl_ModShutdown` was not freeing the data nodes for the level data, it was only freeing the surface data.
To fix this, I have made it use `DynOS_Gfx_Free` to free the `GfxData` correctly. I found that the level script VM will still be trying to warp from the custom level after `DynOS_Lvl_ModShutdown` is executed, so I added a schedule to simply free it the next frame.
I've made it force the level script to change to a vanilla level during mod shutdown. This is critical to ensure the VM doesn't continue to read from a freed level script.

Removed the explicit deletion of data nodes in `DynOS_MovtexQC_ModShutdown` because `DynOS_Gfx_Free` already frees that, and it's actually data owned by the data node, so it's more appropriate in `DynOS_Gfx_Free`
2026-06-15 11:22:03 +10:00
Isaac0-dev
39d351d753
some fixes for dynos, and a crash fix (#1040)
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
2025-12-26 12:59:47 +10:00
djoslin0
24b92ecc2a
Add a safer version of Lua's require() (#847)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
I didn't add standard Lua require() because I've always been
afraid of it. I'm not sure we can guarantee which files it
will read (or not read).

Instead, here is a custom implementation. It should work more
or less the same and allow for more modular code.

For backwards compatibility reasons, all of the lua files in
the base mod folder will be loaded as in the past. Aka one at
a time and alphabetically.

However, now coop will look for Lua files in subdirectories
and will load them in when another Lua file calls require().

The file search order is more reasonable than normal Lua
require(). It will first look for files relative to the
currently running script. If there is no matching relative
file, it will pick from any Lua file that is in any of the
mod's subdirectories.

---------

Co-authored-by: MysterD <myster@d>
2025-06-14 19:49:07 +10:00
MysterD
d043fdd22d Added in-game console for DynOS and Lua errors 2023-05-19 04:20:08 -07:00
Prince Frizzy
5e95fb14f1
Sanity checks for the .bhv system (#293)
* Barebones fix.

* Sanity checks for the .bhv system.

* Two more sanity checks.
2023-02-22 15:12:09 -05:00
MysterD
165a7dd68a Fix up includes for clang 2022-08-05 20:55:31 -07:00
MysterD
3b626845e1 Refactor sync objects, move syncIds to u32 2022-06-06 19:13:04 -07:00
MysterD
091437c430 More custom bhv cleanup 2022-06-02 19:33:28 -07:00
Prince Frizzy
40e1fa9e58
Added a full new custom behavior system (#124) 2022-06-02 12:19:54 -07:00