You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You should be really careful with those direct indexing of getComponent.
I did this in my mod, too (very often) and got randomly "Error occured".
I got this info from UG:
There seems to be problems with temporaries, i.e. somehow "fatInstances" contains garbage, even if it is in the local scope. I still have to pin-point the problem exactly.
It seems that the library we are using to interface with C++ (sol2) is not liking the following:
local comp = api.engine.getComponent(id, api.type.ComponentType.MODEL_INSTANCE_LIST)
local fatInstances = comp.fatInstances
the problem should be fixed.
I think this is a general issue with the library, where the lifetime of certain objects is incorrect, so (as a workaround) I suggest you try (as much as possible) to assign the result of "api" calls to temporary variables.
(This is mostly because the result of "api" calls are not lua tables, but is just lua userdata to real game objects or wrappers around them (in order to avoid expensive copies).)
The text was updated successfully, but these errors were encountered:
TPF2-Timetables/res/scripts/celmi/timetables/timetable_helper.lua
Line 158 in a803a2a
You should be really careful with those direct indexing of getComponent.
I did this in my mod, too (very often) and got randomly "Error occured".
I got this info from UG:
The text was updated successfully, but these errors were encountered: