ClosestExaminer
Member
I am making a multiplayer game.
Client #1 is constantly scanning for instances of object X.
Client #2 asynchronously destroys one of those instances after it was already read on client 1. Then I get an undefined error when trying to reference it because that pointer obviously points to a deallocated instance.
instance_exists is a pretty poor bandaid-- it has huge overhead in a loop, and it still isn't atomic (it lessens the undefined error frequency, but doesn't remove it entirely).
How would I go about handling this atomically with the GML Standard Library?
Thank you
Client #1 is constantly scanning for instances of object X.
Client #2 asynchronously destroys one of those instances after it was already read on client 1. Then I get an undefined error when trying to reference it because that pointer obviously points to a deallocated instance.
instance_exists is a pretty poor bandaid-- it has huge overhead in a loop, and it still isn't atomic (it lessens the undefined error frequency, but doesn't remove it entirely).
How would I go about handling this atomically with the GML Standard Library?
Thank you