]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/weaponsystem.qh
Reorganise some more definitions out of defs.qh, show all racers on the radar in...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / weaponsystem.qh
index dd9e42a24687f49fd0a7c3d9e9d3be93b498194e..23d1e5972ffe74f86298f5fb22f206635bcfe49d 100644 (file)
@@ -2,6 +2,8 @@
 
 #include <server/miscfunctions.qh>
 
+#define INDEPENDENT_ATTACK_FINISHED 1
+
 // there is 2 weapon tics that can run in one server frame
 const int W_TICSPERFRAME = 2;
 
@@ -20,6 +22,15 @@ entity weapon_dropevent_item;
 .int old_clip_load;
 .int clip_size;
 
+.float attack_finished_for[REGISTRY_MAX(Weapons) * 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, slot) ((ent).attack_finished_single[slot])
+#endif
+#define ATTACK_FINISHED(ent, w) ATTACK_FINISHED_FOR(ent, ent.(w).m_weapon.m_id, weaponslot(w))
+
 void CL_SpawnWeaponentity(entity e, .entity weaponentity);
 
 void w_clear(Weapon thiswep, entity actor, .entity weaponentity, int fire);