Hello,
I was wondering why compiler is throwing this errors:
PHP Code:
D:\Custom Projects\Zombie Apocalypse\scripting\Special_Project_ZA.1.0.sma(127 -- 128) : error 012: invalid function call, not a valid address
D:\Custom Projects\Zombie Apocalypse\scripting\Special_Project_ZA.1.0.sma(128) : error 001: expected token: ";", but found ")"
D:\Custom Projects\Zombie Apocalypse\scripting\Special_Project_ZA.1.0.sma(128) : error 029: invalid expression, assumed zero
D:\Custom Projects\Zombie Apocalypse\scripting\Special_Project_ZA.1.0.sma(128) : fatal error 107: too many error messages on one line
I have defined macro like this
PHP Code:
#define SetBit(%1,%2) (%1 |= (1 << (%2 & 31)))
Error is thrown only when the code is written like this:
PHP Code:
g_bLastZombie = true
SetBit(g_bitIsLastZombie, iPlayer)
when I change the position of the bit like this:
PHP Code:
SetBit(g_bitIsLastZombie, iPlayer)
g_bLastZombie = true
compiler is happy, I can't find a concrete explanation for this.
And btw, when I change the macro like this:
PHP Code:
#define SetBit(%1,%2) %1 |= (1 << (%2 & 31))
it's working in both ways.
__________________