From: Mircea Kitsune Date: Sun, 23 Jan 2011 15:58:08 +0000 (+0200) Subject: Move load persistence floats back to their weapon files. That should be the last... X-Git-Tag: xonotic-v0.5.0~309^2~7^2~87 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b0c3dccd19b4e834a28c993430f158109ea0ca38;p=xonotic%2Fxonotic-data.pk3dir.git Move load persistence floats back to their weapon files. That should be the last of the weapon lists, and the reload system should no longer depend on anything weapon-specific outside of the weapon files. --- diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 10f6763fb..ec82bf653 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -616,23 +616,6 @@ float client_cefc_accumulatortime; .float old_clip_load; .float clip_size; -// weapon load persistence, for weapons that support reloading -.float laser_load; -.float shotgun_load; -.float uzi_load; -.float grenadelauncher_load; -.float minelayer_load; -.float electro_load; -.float crylink_load; -.float hlac_load; -.float nex_load; -.float minstanex_load; -.float sniperrifle_load; -.float seeker_load; -.float hagar_load; -.float fireball_load; -.float rocketlauncher_load; - #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE // when doing this, hagar can go through clones // #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX diff --git a/qcsrc/server/w_crylink.qc b/qcsrc/server/w_crylink.qc index 6a823b920..d20811bfa 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -9,6 +9,9 @@ REGISTER_WEAPON(CRYLINK, w_crylink, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLA .entity queuenext; .entity queueprev; +// weapon load persistence, for weapons that support reloading +.float crylink_load; + void W_Crylink_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index a6edd8f2d..4ad5157d2 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -5,6 +5,9 @@ REGISTER_WEAPON(ELECTRO, w_electro, IT_CELLS, 5, WEP_FLAG_NORMAL | WEP_TYPE_SPLA .float electro_count; .float electro_secondarytime; +// weapon load persistence, for weapons that support reloading +.float electro_load; + void W_Electro_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_fireball.qc b/qcsrc/server/w_fireball.qc index f8f745a96..dd1793906 100644 --- a/qcsrc/server/w_fireball.qc +++ b/qcsrc/server/w_fireball.qc @@ -6,6 +6,9 @@ REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_TYPE_SPLASH, BOT_PICKUP_RA .vector fireball_impactvec; .float fireball_primarytime; +// weapon load persistence, for weapons that support reloading +.float fireball_load; + void W_Fireball_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_grenadelauncher.qc b/qcsrc/server/w_grenadelauncher.qc index 43ca76474..970cfa72d 100644 --- a/qcsrc/server/w_grenadelauncher.qc +++ b/qcsrc/server/w_grenadelauncher.qc @@ -5,6 +5,9 @@ REGISTER_WEAPON(GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, 4, WEP_FLAG_NORMAL | .float gl_detonate_later; .float gl_bouncecnt; +// weapon load persistence, for weapons that support reloading +.float grenadelauncher_load; + void W_GrenadeLauncher_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index cbc146915..e982c3a21 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -4,6 +4,9 @@ REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_CANCLI #ifdef SVQC // NO bounce protection, as bounces are limited! +// weapon load persistence, for weapons that support reloading +.float hagar_load; + void W_Hagar_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_hlac.qc b/qcsrc/server/w_hlac.qc index ad12e740d..10ae59c03 100644 --- a/qcsrc/server/w_hlac.qc +++ b/qcsrc/server/w_hlac.qc @@ -3,6 +3,9 @@ REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BO #else #ifdef SVQC +// weapon load persistence, for weapons that support reloading +.float hlac_load; + void W_HLAC_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_laser.qc b/qcsrc/server/w_laser.qc index 222feb1c5..25e272c76 100644 --- a/qcsrc/server/w_laser.qc +++ b/qcsrc/server/w_laser.qc @@ -4,6 +4,9 @@ REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_ #ifdef SVQC void(float imp) W_SwitchWeapon; +// weapon load persistence, for weapons that support reloading +.float laser_load; + void W_Laser_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_minelayer.qc b/qcsrc/server/w_minelayer.qc index b8adb65ff..d2d182223 100644 --- a/qcsrc/server/w_minelayer.qc +++ b/qcsrc/server/w_minelayer.qc @@ -6,6 +6,9 @@ void W_Mine_Think (void); .float minelayer_detonate, minelayer_mines; .float mine_time; +// weapon load persistence, for weapons that support reloading +.float minelayer_load; + void W_MineLayer_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_minstanex.qc b/qcsrc/server/w_minstanex.qc index 03b072b8d..a26dba22f 100644 --- a/qcsrc/server/w_minstanex.qc +++ b/qcsrc/server/w_minstanex.qc @@ -4,6 +4,9 @@ REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_ #ifdef SVQC .float minstanex_lasthit; +// weapon load persistence, for weapons that support reloading +.float minstanex_load; + void W_Minstanex_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index 1210372d1..03806f9f9 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -3,6 +3,9 @@ REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT #else #ifdef SVQC +// weapon load persistence, for weapons that support reloading +.float nex_load; + void W_Nex_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_rocketlauncher.qc b/qcsrc/server/w_rocketlauncher.qc index 85f855e13..85116a1e0 100644 --- a/qcsrc/server/w_rocketlauncher.qc +++ b/qcsrc/server/w_rocketlauncher.qc @@ -5,6 +5,9 @@ REGISTER_WEAPON(ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, 9, WEP_FLAG_NORMAL | W .float rl_release; .float rl_detonate_later; +// weapon load persistence, for weapons that support reloading +.float rocketlauncher_load; + void W_RocketLauncher_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_seeker.qc b/qcsrc/server/w_seeker.qc index a259c74af..cb050f399 100644 --- a/qcsrc/server/w_seeker.qc +++ b/qcsrc/server/w_seeker.qc @@ -5,6 +5,9 @@ REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_TYPE_SPLA //.float proxytime; = autoswitch //.float tl; = wait +// weapon load persistence, for weapons that support reloading +.float seeker_load; + void W_Seeker_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index 78060ec7d..7d515ddee 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -3,6 +3,9 @@ REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HIT #else #ifdef SVQC +// weapon load persistence, for weapons that support reloading +.float shotgun_load; + void W_Shotgun_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_sniperrifle.qc b/qcsrc/server/w_sniperrifle.qc index 9e016b256..c19c74427 100644 --- a/qcsrc/server/w_sniperrifle.qc +++ b/qcsrc/server/w_sniperrifle.qc @@ -8,6 +8,9 @@ REGISTER_WEAPON(SNIPERRIFLE, w_sniperrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_T .float sniperrifle_accumulator; +// weapon load persistence, for weapons that support reloading +.float sniperrifle_load; + void W_SniperRifle_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading diff --git a/qcsrc/server/w_uzi.qc b/qcsrc/server/w_uzi.qc index b52a741a3..1fe188e69 100644 --- a/qcsrc/server/w_uzi.qc +++ b/qcsrc/server/w_uzi.qc @@ -3,6 +3,9 @@ REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT #else #ifdef SVQC +// weapon load persistence, for weapons that support reloading +.float uzi_load; + void W_UZI_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading