qoh / BlocklandLua

Use Lua directly within Blockland.
11 stars 4 forks source link

`ts.obj` references are volatile and provide no way of checking validity #5

Closed qoh closed 9 years ago

qoh commented 9 years ago

A ts.obj reference directly stores a SimObject * pointer. This means extremely fast property access and method calls, but also means that it could suddenly be pointing at the void if the object is deleted. There is currently no way to detect this, which makes it even more of a problem; it'll likely just crash the game if you try to use it.

Some possible solutions:

qoh commented 9 years ago

exists = (Sim::findObject(tso->id) != NULL)