Cannot check MTF_EXTRA?

Goldenhog

Wandering Protagonist
Code:
if (mo.spawnpoint.options & MTF_EXTRA)
(...)
end

This does not work, it throws up an "attempt to perform arithmetic on global 'MTF_EXTRA' (a nil value)" error. I know the syntax is correct, because if I change it to MTF_OBJECTFLIP, MTF_OBJECTSPECIAL or MTF_AMBUSH, it works.

Did the way MTF_EXTRA changed and the wiki is not up to date with it yet, or is it bugged?
 
For some reason, I don't recall MTF_EXTRA ever working in Lua back in 2.1, I've always had to manually redefine it. I suppose this wasn't fixed in 2.2.

In the meantime you can just add
Code:
local MTF_EXTRA = 1
on relevant parts.
 
I can confirm that nothing in v2.2.0's source code seems to push MTF_EXTRA to Lua stuff, while the other map thing flags are properly pushed.

Whether or not that's intentional, I don't know, but there aren't any comments in the source code stating that it's intentional.
 
Last edited:
IIRC what we now know as "MTF_EXTRA" didn't have a name at all in 2.1, and we accounted for that lack of name in the code that parses SOC/Lua at the time. Obviously we forgot to update said code once it got a name in 2.2.

In other words this is a bug and it is not intentional.
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top