mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-03 00:16:50 +00:00
- optimize fall back lua state listener
This commit is contained in:
parent
19e28a3d4d
commit
f46442d085
@ -13,16 +13,19 @@ int BeamNG::lua_open_jit_D(lua_State* State) {
|
||||
Memory::Print("Got lua State -> " + Memory::GetHex(reinterpret_cast<uint64_t>(State)));
|
||||
GELua::State = State;
|
||||
RegisterGEFunctions();
|
||||
UpdateDetour->Enable();
|
||||
return OpenJITDetour->Original(State);
|
||||
}
|
||||
|
||||
uint64_t BeamNG::update_D(lua_State* State) {
|
||||
if(GELua::State != State) {
|
||||
Memory::Print("Got lua State -> " + Memory::GetHex(reinterpret_cast<uint64_t>(State)));
|
||||
Memory::Print("Fallback Got lua State -> " + Memory::GetHex(reinterpret_cast<uint64_t>(State)));
|
||||
GELua::State = State;
|
||||
RegisterGEFunctions();
|
||||
}
|
||||
return UpdateDetour->Original(State);
|
||||
auto ret = UpdateDetour->Original(State);
|
||||
UpdateDetour->Disable();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void BeamNG::EntryPoint() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user