From: Mircea Kitsune Date: Sat, 22 Jan 2011 18:27:25 +0000 (+0200) Subject: Move weapon load floats in defs.qh, rather than in each weapon file. Necessary to... X-Git-Tag: xonotic-v0.5.0~309^2~7^2~100 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a3e6c5697b452f706c2fa226c4de1939928beb1f;p=xonotic%2Fxonotic-data.pk3dir.git Move weapon load floats in defs.qh, rather than in each weapon file. Necessary to properly access them from the server code in some cases --- diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 82b53fcad..06d0a3bf5 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -617,6 +617,23 @@ float client_cefc_accumulatortime; .float clip_size; .float wish_reload; +// 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 adfe3e25b..73f9f5864 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -9,8 +9,6 @@ REGISTER_WEAPON(CRYLINK, w_crylink, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLA .entity queuenext; .entity queueprev; -.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 4e12ffda3..cd03bdceb 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -5,8 +5,6 @@ REGISTER_WEAPON(ELECTRO, w_electro, IT_CELLS, 5, WEP_FLAG_NORMAL | WEP_TYPE_SPLA .float electro_count; .float electro_secondarytime; -.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 3130a9303..ea34c80af 100644 --- a/qcsrc/server/w_fireball.qc +++ b/qcsrc/server/w_fireball.qc @@ -6,8 +6,6 @@ REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_TYPE_SPLASH, BOT_PICKUP_RA .vector fireball_impactvec; .float fireball_primarytime; -.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 569916206..77bf031b3 100644 --- a/qcsrc/server/w_grenadelauncher.qc +++ b/qcsrc/server/w_grenadelauncher.qc @@ -5,8 +5,6 @@ REGISTER_WEAPON(GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, 4, WEP_FLAG_NORMAL | .float gl_detonate_later; .float gl_bouncecnt; -.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 be2b0241b..2a8e4d7f4 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -4,8 +4,6 @@ REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_CANCLI #ifdef SVQC // NO bounce protection, as bounces are limited! -.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 006c4d3ba..bdbb88bc6 100644 --- a/qcsrc/server/w_hlac.qc +++ b/qcsrc/server/w_hlac.qc @@ -3,8 +3,6 @@ REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BO #else #ifdef SVQC -.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 0e23c6b40..33a9c164d 100644 --- a/qcsrc/server/w_laser.qc +++ b/qcsrc/server/w_laser.qc @@ -4,8 +4,6 @@ REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_ #ifdef SVQC void(float imp) W_SwitchWeapon; -.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 362e93556..6d307bb2f 100644 --- a/qcsrc/server/w_minelayer.qc +++ b/qcsrc/server/w_minelayer.qc @@ -6,8 +6,6 @@ void W_Mine_Think (void); .float minelayer_detonate, minelayer_mines; .float mine_time; -.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 3a5d6f5e6..8b01ceee8 100644 --- a/qcsrc/server/w_minstanex.qc +++ b/qcsrc/server/w_minstanex.qc @@ -4,8 +4,6 @@ REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_ #ifdef SVQC .float minstanex_lasthit; -.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 7abde095f..e93262e92 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -3,8 +3,6 @@ REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT #else #ifdef SVQC -.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 96a4f0b15..ab30b0712 100644 --- a/qcsrc/server/w_rocketlauncher.qc +++ b/qcsrc/server/w_rocketlauncher.qc @@ -5,8 +5,6 @@ REGISTER_WEAPON(ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, 9, WEP_FLAG_NORMAL | W .float rl_release; .float rl_detonate_later; -.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 f69a38cbc..b1cde626a 100644 --- a/qcsrc/server/w_seeker.qc +++ b/qcsrc/server/w_seeker.qc @@ -5,8 +5,6 @@ REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_TYPE_SPLA //.float proxytime; = autoswitch //.float tl; = wait -.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 acf65a1f9..50ad77bde 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -3,8 +3,6 @@ REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HIT #else #ifdef SVQC -.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 7577495f8..359ab4dfa 100644 --- a/qcsrc/server/w_sniperrifle.qc +++ b/qcsrc/server/w_sniperrifle.qc @@ -7,7 +7,6 @@ REGISTER_WEAPON(SNIPERRIFLE, w_sniperrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_T //** In fully automatic mode some of the gas is used to extract and reload the next cartrige, thus there is less power and range. .float sniperrifle_accumulator; -.float sniperrifle_load; void W_SniperRifle_SetAmmoCounter() { diff --git a/qcsrc/server/w_uzi.qc b/qcsrc/server/w_uzi.qc index ab6e43580..d84128343 100644 --- a/qcsrc/server/w_uzi.qc +++ b/qcsrc/server/w_uzi.qc @@ -3,8 +3,6 @@ REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT #else #ifdef SVQC -.float uzi_load; - void W_UZI_SetAmmoCounter() { // set clip_load to the weapon we have switched to, if the gun uses reloading