-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BPModLoaderMod: Fix problem with out-of-scope variables in async call and ensure that LoadMods is always called in a game thread #752
base: main
Are you sure you want to change the base?
Conversation
feat: Make sure that LoadMods gets executed in a game thread refactor: Change code order to make sure that functions are over the code the gets executed on mod load
…. It can only happen if there is a bug in BPModLoaderMod's code.
The code looks good but I don't link the changes to |
Why? It's the whole point of a function. To take code that is repetitive and do it once.
Each of the default Lua mods has its own implementation of the If you want consistency and do it right, it would be better to make a sort of Utils library that has such functions that every mod can use. |
As far as I can tell, there's only one outlier and that's ConsoleCommandsMod. We also shouldn't be creating a wrapper for Making changes to the log function isn't within the scope of what this PR is trying to do, which is fix a bug with unsafely accessing variables asynchronously, it's unnecessarily causing bloat in the diff. |
9031c8d
to
ada6a92
Compare
Log changes reverted, Changelog edited. |
Description
ExecuteInGameThread
call from theLoadMod
function.LoadMods
is always called in a game thread instead.error
messages in case theWorld
is nil in either theLoadMods
orLoadMod
function.According to the current mod logic with the new UEHelpers v3, the parameter
World
shouldn't benil
in eitherLoadMods
orLoadMod
. It can be an invalid UObject, but nevernil
. Therefore, if it should happen, we should assume that it is an error in BPModLoaderMod's code.Quality control
Tested in Palworld v0.4.12 with Mod Config Menu (UI) and Basic MiniMap mods.
Here is a snippet from the log file without timestamps for better visibility:
Review
Please review the code, then when the code is approved, I'll write the Changelog and make a PR out of the Draft.