]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/defs.qh
Weapons: add a second .weaponentity
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / defs.qh
index 99814e015415da9d3eb8dd53682e51f1b0c5f221..0e5fd677636c74c18b4dabab9d59cec4f976ef0d 100644 (file)
@@ -151,7 +151,7 @@ const float MAX_DAMAGEEXTRARADIUS = 16;
 
 // definitions for weaponsystem
 // more WEAPONTODO: move these to their proper files
-.entity weaponentity;
+.entity weaponentity[MAX_WEAPONSLOTS];
 .entity exteriorweaponentity;
 .vector weaponentity_glowmod;
 
@@ -261,14 +261,14 @@ WepSet weaponsInMap;
 
 float bot_waypoints_for_items;
 
-.float attack_finished_for[Weapons_MAX];
-.float attack_finished_single;
-#ifdef INDEPENDENT_ATTACK_FINISHED
-#define ATTACK_FINISHED_FOR(ent,w) ((ent).(attack_finished_for[(w) - WEP_FIRST]))
+.float attack_finished_for[Weapons_MAX * MAX_WEAPONSLOTS];
+.float attack_finished_single[MAX_WEAPONSLOTS];
+#if INDEPENDENT_ATTACK_FINISHED
+#define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).(attack_finished_for[((w) - WEP_FIRST) * MAX_WEAPONSLOTS + (slot)]))
 #else
-#define ATTACK_FINISHED_FOR(ent,w) ((ent).attack_finished_single)
+#define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).attack_finished_single[slot])
 #endif
-#define ATTACK_FINISHED(ent) ATTACK_FINISHED_FOR(ent,(ent).weapon)
+#define ATTACK_FINISHED(ent, slot) ATTACK_FINISHED_FOR(ent, (ent).weapon, slot)
 
 // assault game mode: Which team is attacking in this round?
 float assault_attacker_team;