Something weird about moveresult.collisions
Posted: Sat Feb 06, 2021 11:41
I tried to use moveresult.collisions.type to check if an object is colliding with a node or other object, but it wouldn't work... Untill I used a minetest.serialize() trick to check what the full table looks like and noticed that it's properties are stored in double table brackets {{ }}
While hpchange for example, uses single table brackets {}, so the feature that I need, only works if I write it like:
moveresult.collisions[1].type
And having to use [1] seems a little weird, considering it seems to be the only element in "collisions" table aniway...
So is it intentional, or will it be changed in near future?
While hpchange for example, uses single table brackets {}, so the feature that I need, only works if I write it like:
moveresult.collisions[1].type
And having to use [1] seems a little weird, considering it seems to be the only element in "collisions" table aniway...
So is it intentional, or will it be changed in near future?