]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
More server side code I forgot
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 15:01:58 +0000 (17:01 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 15:01:58 +0000 (17:01 +0200)
data/qcsrc/common/constants.qh
data/qcsrc/server/cl_client.qc
data/qcsrc/server/g_world.qc

index 76ca2167ee107e5b090d7b33873931eede268767..c0e402d87daf6fad2870d9ce61bf4d4be3528648 100644 (file)
@@ -277,16 +277,18 @@ const float STAT_NB_METERSTART = 45;
 const float STAT_SHOTORG = 46; // compressShotOrigin\r
 const float STAT_LEADLIMIT = 47;\r
 const float STAT_WINNING = 48;\r
-const float STAT_LAST_PICKUP = 49;\r
-const float STAT_VORE_LOAD = 50;\r
-const float STAT_VORE_DIGESTING = 51;\r
-const float STAT_VORE_EATEN = 52;\r
-const float STAT_VORE_CANLEAVE = 53;\r
+const float STAT_WEAPON_CLIPLOAD = 49;\r
+const float STAT_WEAPON_CLIPSIZE = 50;\r
+const float STAT_LAST_PICKUP = 51;\r
+const float STAT_VORE_LOAD = 52;\r
+const float STAT_VORE_DIGESTING = 53;\r
+const float STAT_VORE_EATEN = 54;\r
+const float STAT_VORE_CANLEAVE = 55;\r
 const float CTF_STATE_ATTACK = 1;\r
 const float CTF_STATE_DEFEND = 2;\r
 const float CTF_STATE_COMMANDER = 3;\r
 \r
-const float STAT_HUD = 54;\r
+const float STAT_HUD = 56;\r
 const float HUD_NORMAL = 0;\r
 \r
 // moved that here so the client knows the max.\r
index 19f8d0c9fe90230925864dc2c9bbdbf94de2bfe7..937a73d66778ae84e2eb8da446aeedd525af48a6 100644 (file)
@@ -2029,6 +2029,8 @@ void SpectateCopy(entity spectatee) {
        self.armortype = spectatee.armortype;\r
        self.armorvalue = spectatee.armorvalue;\r
        self.ammo_fuel = spectatee.ammo_fuel;\r
+       self.clip_load = spectatee.clip_load;\r
+       self.clip_size = spectatee.clip_size;\r
        self.effects = spectatee.effects & EFMASK_CHEAP; // eat performance\r
        self.health = spectatee.health;\r
        self.impulse = 0;\r
@@ -2663,6 +2665,10 @@ void PlayerPreThink (void)
        }\r
 \r
        target_voicescript_next(self);\r
+\r
+       // if a player goes unarmed after holding a loaded weapon, empty his clip size and remove the crosshair ammo ring\r
+       if(!self.weapon)\r
+               self.clip_load = self.clip_size = 0;\r
 }\r
 \r
 float isInvisibleString(string s)\r
index 82186ec3193dae039983b20b63a9e117f6b7bfea..e1174dd24f16dcb962c673b5d06f57fb96e5e95b 100644 (file)
@@ -654,6 +654,8 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_DAMAGE_FIRED, AS_INT, stat_fired);\r
        addstat(STAT_SHOTORG, AS_INT, stat_shotorg);\r
        addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);\r
+       addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load);\r
+       addstat(STAT_WEAPON_CLIPSIZE, AS_INT, clip_size);\r
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);\r
        addstat(STAT_WINNING, AS_FLOAT, winning);\r
        addstat(STAT_VORE_LOAD, AS_INT, stat_stomachload);\r