Skip to content

Commit d85d16b

Browse files
committed
refactor(FText): Remove FText_Constructor.lua as an override
It's no longer needed because we no longer call the FText constructor directly.
1 parent 83b2a4a commit d85d16b

File tree

3 files changed

+3
-47
lines changed

3 files changed

+3
-47
lines changed

UE4SS/src/Signatures.cpp

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -259,52 +259,6 @@ namespace RC
259259
};
260260
}
261261

262-
auto lua_ftc_scan_script = working_directory / "UE4SS_Signatures/FText_Constructor.lua";
263-
if (std::filesystem::exists(lua_ftc_scan_script))
264-
{
265-
config.ScanOverrides.ftext_constructor = [lua_ftc_scan_script](std::vector<SignatureContainer>& signature_containers,
266-
Unreal::Signatures::ScanResult& scan_result) mutable {
267-
scan_from_lua_script(
268-
lua_ftc_scan_script,
269-
signature_containers,
270-
[&scan_result](void* address) {
271-
if (!Unreal::GMalloc || !*Unreal::GMalloc)
272-
{
273-
scan_result.Errors.emplace_back("Lua script 'FText_Constructor.lua' cannot be tried; GMalloc nullptr.");
274-
return DidLuaScanSucceed::No;
275-
}
276-
Unreal::FText text{};
277-
SEH_TRY({ text = Unreal::FText(STR("bCanBeDamaged"), address); })
278-
SEH_EXCEPT({ Output::send<LogLevel::Error>(STR("Error: Crashed calling FText constructor.\n")); });
279-
280-
DidLuaScanSucceed did_succeed{};
281-
SEH_TRY({
282-
if (text == STR("bCanBeDamaged"))
283-
{
284-
Output::send(STR("FText::FText address: {} <- Lua Script\n"), address);
285-
Unreal::FText::ConstructorInternal.assign_address(address);
286-
did_succeed = DidLuaScanSucceed::Yes;
287-
}
288-
else
289-
{
290-
scan_result.Errors.emplace_back("Lua script 'FText_Constructor.lua' did not return a "
291-
"valid address for FText::FText.");
292-
did_succeed = DidLuaScanSucceed::No;
293-
}
294-
})
295-
SEH_EXCEPT({ Output::send<LogLevel::Error>(STR("Error: Crashed calling FText::ToString.\n")); })
296-
return did_succeed;
297-
},
298-
[&scan_result]([[maybe_unused]] DidLuaScanSucceed did_lua_scan_succeed) {
299-
if (!Unreal::FText::ConstructorInternal.get_function_address())
300-
{
301-
scan_result.Errors.emplace_back("Lua script 'FText_Constructor.lua' did not return a "
302-
"valid address for FText::FText.");
303-
}
304-
});
305-
};
306-
}
307-
308262
auto lua_guhashtables_scan_script = working_directory / "UE4SS_Signatures/GUObjectHashTables.lua";
309263
if (std::filesystem::exists(lua_guhashtables_scan_script))
310264
{

assets/Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ Removed some development mods, `README.md` & `Changelog.md` from non-zDev releas
311311

312312
The execution of the game is now paused durin the first AOB scan, and then resumed to complete potential further scans and initialization. ([UE4SS #985](https://github.com/UE4SS-RE/RE-UE4SS/pull/985))
313313

314+
Removed the FText constructor AOB, replaced it with more consistent non-AOB method of constructing FText instances ([UE4SS #1139](https://github.com/UE4SS-RE/RE-UE4SS/pull/1139))
315+
314316
### Live View
315317
Fixed the majority of the lag ([UE4SS #512](https://github.com/UE4SS-RE/RE-UE4SS/pull/512))
316318

deps/first/Unreal

0 commit comments

Comments
 (0)