From e4acb7b6afcd64284f9158c2fadfa844d792ee31 Mon Sep 17 00:00:00 2001 From: IQuant Date: Wed, 13 Nov 2024 19:47:48 +0300 Subject: [PATCH] Set a more proper type --- ewext/src/lib.rs | 4 ++-- ewext/src/noita/ntypes.rs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) 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);