Page 1 of 1

Comparing entity tables

Posted: Tue Sep 24, 2013 12:06 pm
by rk84
I would like to avoid saving multiple references to same entity. so some method comparing them would be nice. ID mayby?

-methods like findentities and getselected always create new table for entity. So can't use reference number.
-some entities can be stacked. so position is not fit for all cases.

Re: Comparing entity tables

Posted: Wed Sep 25, 2013 1:58 pm
by ficolas
as a workarround you can try to move it/modify it some way, then compare that thing, then move it back, and compare the original position.

Re: Comparing entity tables

Posted: Wed Sep 25, 2013 2:49 pm
by kovarex
There is method equals. It checks if those references point to the same entity.

Re: Comparing entity tables

Posted: Wed Sep 25, 2013 3:11 pm
by rk84
@ficolas
thanks for suggestion.

@kovarex
ah I remember seeing that in Lua/force wikipage. Thank you.