diff --git a/ewext/src/lib.rs b/ewext/src/lib.rs index 48f8e3a4..05a5bee9 100644 --- a/ewext/src/lib.rs +++ b/ewext/src/lib.rs @@ -9,7 +9,7 @@ use std::{ use iced_x86::Mnemonic; use lua_bindings::{lua_State, Lua51, LUA_GLOBALSINDEX}; use noita::{ - ntypes::{Entity, EntityManager}, + ntypes::{Entity, EntityManager, ThiscallFn}, NoitaPixelRun, ParticleWorldState, }; @@ -44,7 +44,7 @@ struct GrabbedGlobals { } struct GrabbedFns { - get_entity: unsafe extern "C" fn(*const EntityManager, u32) -> *mut Entity, + get_entity: *const ThiscallFn, //unsafe extern "C" fn(*const EntityManager, u32) -> *mut Entity, } #[derive(Default)] diff --git a/ewext/src/noita/ntypes.rs b/ewext/src/noita/ntypes.rs index c48f4171..81407220 100644 --- a/ewext/src/noita/ntypes.rs +++ b/ewext/src/noita/ntypes.rs @@ -78,3 +78,6 @@ pub(crate) struct EntityManager { _fld: c_void, // Unknown } + +#[repr(C)] +pub(crate) struct ThiscallFn(c_void);