04-19-2012, 06:26 PM
qcsrc / common / items.qh
http://git.xonotic.org/?p=xonotic/xonoti...5a;hb=HEAD
I enabled the idef'd code here:
And defined STAT_WEAPONS2 as some number (is this correct?) in qcsrc / common / constants.qh
http://git.xonotic.org/?p=xonotic/xonoti...4d;hb=HEAD
Compiled fine. Runs fine, untill I add the 25th weapon to compile in, or so.
Then I get a crash in the quakeC. So it seems, I guess, I have to add a macro to the 25th and above weapons I guess. What would that be?
Please don't ask why. Trying to test this if you need an answer to "why would you want to add more weapons".
http://git.xonotic.org/?p=xonotic/xonoti...5a;hb=HEAD
I enabled the idef'd code here:
Code:
121 #else
122 # define WEP_MAXCOUNT 48
123 # define WEP_FIRST2 25
124 .float _WS1_weapons;
125 .float _WS2_weapons;
126 # define WEPSET_BIT1(a) (((a) < WEP_FIRST2) ? power2of((a) - WEP_FIRST) : 0)
127 # define WEPSET_BIT2(a) (((a) >= WEP_FIRST2) ? power2of((a) - WEP_FIRST2) : 0)
128 # define WEPSET_DECLARE_A(a) float _WS1_##a, _WS2_##a
129 # define WEPSET_CLEAR_E(e) ((e)._WS1_weapons = (e)._WS2_weapons = 0)
130 # define WEPSET_CLEAR_A(a) ((_WS1_##a) = (_WS2_##a) = 0)
131 # define WEPSET_EMPTY_E(e) ((e)._WS1_weapons == 0 && (e)._WS2_weapons == 0)
132 # define WEPSET_EMPTY_A(a) ((_WS1_##a) == 0 && (_WS2_##a) == 0)
133 # define WEPSET_COPY_AS(a) ((_WS1_##a) = getstati(STAT_WEAPONS), (_WS2_##a) = getstati(STAT_WEAPONS2))
134 # define WEPSET_ADDSTAT() addstat(STAT_WEAPONS, AS_INT, _WS1_weapons); addstat(STAT_WEAPONS2, AS_INT, _WS2_weapons)
135 # define WEPSET_OP1_EE(a,b,mergeop,x) (((a)._WS1_weapons x (b)._WS1_weapons) mergeop ((a)._WS2_weapons x (b)._WS2_weapons))
136 # define WEPSET_OP2_EE(a,b,mergeop,x,y) (((a)._WS1_weapons x (b)._WS1_weapons y (a)._WS1_weapons) mergeop ((a)._WS2_weapons x (b)._WS2_weapons y (a)._WS2_weapons))
137 # define WEPSET_OP1_EA(a,b,mergeop,x) (((a)._WS1_weapons x _WS1_##b) mergeop ((a)._WS2_weapons x _WS2_##b))
138 # define WEPSET_OP2_EA(a,b,mergeop,x,y) (((a)._WS1_weapons x _WS1_##b y (a)._WS1_weapons) mergeop ((a)._WS2_weapons x _WS2_##b y (a)._WS2_weapons))
139 # define WEPSET_OP1_EW(a,b,mergeop,x) (((a)._WS1_weapons x WEPSET_BIT1(b)) mergeop ((a)._WS2_weapons x WEPSET_BIT2(b)))
140 # define WEPSET_OP2_EW(a,b,mergeop,x,y) (((a)._WS1_weapons x WEPSET_BIT1(b) y (a)._WS1_weapons) mergeop ((a)._WS2_weapons x WEPSET_BIT2(b) y (a)._WS2_weapons))
141 # define WEPSET_OP1_AE(a,b,mergeop,x) ((_WS1_##a x (b)._WS1_weapons) mergeop (_WS2_##a x (b)._WS2_weapons))
142 # define WEPSET_OP2_AE(a,b,mergeop,x,y) ((_WS1_##a x (b)._WS1_weapons y _WS1_##a) mergeop (_WS2_##a x (b)._WS2_weapons y _WS2_##a))
143 # define WEPSET_OP1_AA(a,b,mergeop,x) ((_WS1_##a x _WS1_##b) mergeop (_WS2_##a x _WS2_##b))
144 # define WEPSET_OP2_AA(a,b,mergeop,x,y) ((_WS1_##a x _WS1_##b y _WS1_##a) mergeop (_WS2_##a x _WS2_##b y _WS2_##a))
145 # define WEPSET_OP1_AW(a,b,mergeop,x) ((_WS1_##a x WEPSET_BIT1(b)) mergeop (_WS2_##a x WEPSET_BIT2(b)))
146 # define WEPSET_OP2_AW(a,b,mergeop,x,y) ((_WS1_##a x WEPSET_BIT1(b) y _WS1_##a) mergeop (_WS2_##a x WEPSET_BIT2(b) y _WS2_##a))
147 #endif
And defined STAT_WEAPONS2 as some number (is this correct?) in qcsrc / common / constants.qh
http://git.xonotic.org/?p=xonotic/xonoti...4d;hb=HEAD
Compiled fine. Runs fine, untill I add the 25th weapon to compile in, or so.
Then I get a crash in the quakeC. So it seems, I guess, I have to add a macro to the 25th and above weapons I guess. What would that be?
Please don't ask why. Trying to test this if you need an answer to "why would you want to add more weapons".