projects
/
xonotic
/
xonotic-data.pk3dir.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af40024
)
Add SPAWNFUNC_WEAPON_COND macro for game compatibility (matches SPAWNFUNC_ITEM_COND)
author
Mario <mario.mario@y7mail.com>
Fri, 10 Jul 2020 14:37:58 +0000
(
00:37
+1000)
committer
Mario <mario.mario@y7mail.com>
Fri, 10 Jul 2020 14:37:58 +0000
(
00:37
+1000)
qcsrc/common/weapons/weapon.qh
patch
|
blob
|
history
diff --git
a/qcsrc/common/weapons/weapon.qh
b/qcsrc/common/weapons/weapon.qh
index 02fbdb536c283c669714f2ac754df048f3bacd9f..38134fa3d68cb66bef6ed9ef5a111b07ce5a88f7 100644
(file)
--- a/
qcsrc/common/weapons/weapon.qh
+++ b/
qcsrc/common/weapons/weapon.qh
@@
-129,10
+129,19
@@
void weapon_defaultspawnfunc(entity this, Weapon e);
#define SPAWNFUNC_WEAPON(name, weapon) \
spawnfunc(name) { weapon_defaultspawnfunc(this, weapon); }
+#define SPAWNFUNC_WEAPON_COND(name, cond, wep1, wep2) \
+ spawnfunc(name) \
+ { \
+ entity wep = (cond) ? wep1 : wep2; \
+ weapon_defaultspawnfunc(this, wep); \
+ }
+
#else
#define SPAWNFUNC_WEAPON(name, weapon)
+#define SPAWNFUNC_WEAPON_COND(name, weapon)
+
#endif
#include <common/items/_mod.qh>