diff --git a/ewext/src/lib.rs b/ewext/src/lib.rs index 4ac8c905..d9a82f29 100644 --- a/ewext/src/lib.rs +++ b/ewext/src/lib.rs @@ -8,6 +8,7 @@ use modules::{Module, ModuleCtx, entity_sync::EntitySync}; use net::NetManager; use noita_api::add_lua_fn; use noita_api::addr_grabber::Globals; +use noita_api::heap::raw_new; use noita_api::noita::types::EntityManager; use noita_api::noita::world::ParticleWorldState; use noita_api::{ @@ -357,6 +358,7 @@ pub(crate) fn print_error(error: eyre::Report) -> eyre::Result<()> { pub unsafe extern "C" fn luaopen_ewext(lua: *mut lua_State) -> c_int { #[cfg(debug_assertions)] println!("Initializing ewext"); + raw_new(1); if let Err(_e) = KEEP_SELF_LOADED.as_ref() { #[cfg(debug_assertions)] diff --git a/noita_api/src/heap.rs b/noita_api/src/heap.rs index 239b18cf..51491cce 100644 --- a/noita_api/src/heap.rs +++ b/noita_api/src/heap.rs @@ -7,12 +7,10 @@ struct Msvcr { } static MSVCR: LazyLock = LazyLock::new(|| unsafe { - println!("Loading MSVCR"); let lib = libloading::Library::new("./msvcr120.dll").expect("library to exist"); - let op_new = *lib.get(b"operator_new\0").expect("symbol to exist"); + let op_new = *lib.get(b"??2@YAPAXI@Z\0").expect("symbol to exist"); // let op_delete = *lib.get(b"operator_delete\0").expect("symbol to exist"); // let op_delete_array = *lib.get(b"operator_delete[]\0").expect("symbol to exist"); - println!("Load OK"); Msvcr { op_new, // op_delete,