Damn, youre right. There must be something else wrong with my code.
Here is something that REALLY doesnt work:
[...]
for wdname, wd in pairs(ud.weapondefs) do
for wi, w in ipairs(ud.weapons) do
if wdname == w["def"] then -- DOESNT WORK
[...]
Why is wdname never equal to w.def? Def must be equal to wdname, but the code doesnt trigger. If I set to "true", the code below triggers.
Example, weapons & weaponsdef
https://github.com/ZeroK-RTS/Zero-K/blob/master/units/cloakraid.lua