Jump to content

Recommended Posts

Suppose I do:

============

local Iua = {"it", "sucks"}

.......

XX:ListenForEvent("whatever", DoArrayOperation(Iua), nil)

.......

TheWorld:DoPeriodicTask(1,DoArrayOperation(lua))

===========

Assuming DoArrayOperation modifies the array, is there a potential race condition between the event handler and the periodic task thread? If so, what's the "correct" way to avoid this in DST?

 

Also are there any ways to monitor the onremove event of ALL entities without explicitly hooking every entity? I'm working on a better world regrowth mod and I'm currently stuck because Klei only pushes "onbeginregrowth" event for prefabs that are already renewable (why?). I had to either hook everything at the beginning meaning that I'll miss player planted entities or rehook everything periodically which potentially is a performance killer. I don't feel like modifying/overwriting any source files because I want maximum compatibility with updates unless they change the API which they shouldn't.

 

Thank you for your time!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...