]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon.qh
Weapons: make WepSet_FromWeapon more verbose, making Weapons_from uses more obvious
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon.qh
index 2a92f955b50fc1cd16beb89dbe64f50de2ec3c2f..bc98da4330f81278254b76c9296d1a4b12f24552 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef WEAPON_H
 #define WEAPON_H
 #include "../items/item/pickup.qh"
+#include "../stats.qh"
 
 const int MAX_WEAPONSLOTS = 2;
 .entity weaponentities[MAX_WEAPONSLOTS];
@@ -29,6 +30,15 @@ const int WS_INUSE  = 3;
 /** idle frame */
 const int WS_READY  = 4;
 
+#ifdef SVQC
+.int ammo_shells;
+.int ammo_nails;
+.int ammo_rockets;
+.int ammo_cells;
+.int ammo_plasma = _STAT(PLASMA);
+.int ammo_fuel = _STAT(FUEL);
+.int ammo_none;
+#else
 .int ammo_shells;
 .int ammo_nails;
 .int ammo_rockets;
@@ -36,6 +46,7 @@ const int WS_READY  = 4;
 .int ammo_plasma;
 .int ammo_fuel;
 .int ammo_none;
+#endif
 
 /** fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A" */
 CLASS(Weapon, Object)
@@ -107,6 +118,8 @@ CLASS(Weapon, Object)
         // no weapon specific image for this weapon
         return false;
     }
+    /** (CLIENT) weapon specific glow */
+    METHOD(Weapon, wr_glow, vector(Weapon this)) { return '0 0 0'; }
     /** (SERVER) the weapon is dropped */
     METHOD(Weapon, wr_drop, void(Weapon this)) {}
     /** (SERVER) a weapon is picked up */
@@ -205,6 +218,6 @@ string W_Model(string w_mdl);
 
 // other useful macros
 #define WEP_AMMO(wpn) (WEP_##wpn.ammo_field) // only used inside weapon files/with direct name, don't duplicate prefix
-#define WEP_NAME(wpn) ((get_weaponinfo(wpn)).m_name)
+#define WEP_NAME(wpn) ((Weapons_from(wpn)).m_name)
 
 #endif