]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/divVerent/nixnex-fixes'
authorRudolf Polzer <divVerent@xonotic.org>
Wed, 24 Aug 2011 08:39:53 +0000 (10:39 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Wed, 24 Aug 2011 08:39:53 +0000 (10:39 +0200)
qcsrc/common/constants.qh
qcsrc/server/cl_client.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/defs.qh
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/w_hagar.qc
xonotic-credits.txt

index 82b306506fe41387d843ab072babd34635a5e183..9180b668321a2e202eb80f702ef7059c267966a4 100644 (file)
@@ -669,6 +669,7 @@ float WR_RESETPLAYER    = 10; // (SVQC) does not need to do anything
 float WR_IMPACTEFFECT  = 11; // (CSQC) impact effect
 float WR_SWITCHABLE    = 12; // (CSQC) impact effect
 float WR_PLAYERDEATH    = 13; // (SVQC) does not need to do anything
+float WR_GONETHINK     = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
 
 float HUD_PANEL_WEAPONS                = 0;
 float HUD_PANEL_AMMO           = 1;
index 6ea97a656cdbde2a372b01738af37032b39815ee..f3d34bb47531dcef705aa032d86a40fb8fae9db2 100644 (file)
@@ -1086,7 +1086,6 @@ void PutClientInServer (void)
                        if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                                self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
                }
-               self.weapon_forbidchange = FALSE;
 
                oldself = self;
                self = spot;
index 3106169008cad0d4ec5029cfe9d2dbb06c32c22c..658fe54d32901b2b689df87a6424ad47c05d9288 100644 (file)
@@ -284,8 +284,6 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce)
        w = self.weapon;
        if (w == 0)
                return; // just in case
-       if(self.weapon_forbidchange)
-               return;
        if(MUTATOR_CALLHOOK(ForbidThrowCurrentWeapon))
                return;
        if(!autocvar_g_weapon_throwable)
@@ -405,13 +403,16 @@ void W_WeaponFrame()
                        W_SwitchWeapon_Force(self, w_getbestweapon(self));
                        wb = 0;
                }
+
+               v_forward = fo;
+               v_right = ri;
+               v_up = up;
+
                if(wb)
-               {
-                       v_forward = fo;
-                       v_right = ri;
-                       v_up = up;
                        weapon_action(self.weapon, WR_THINK);
-               }
+               else
+                       weapon_action(self.weapon, WR_GONETHINK);
+
                if (time + self.weapon_frametime * 0.5 >= self.weapon_nextthink)
                {
                        if(self.weapon_think)
index 3d7a33278d15201ce89b789f1a03f9441e0d0be8..d1db16d4ca462feaf5c5796cff015b372b0dd190 100644 (file)
@@ -34,10 +34,6 @@ float W_WeaponRateFactor()
 
 void W_SwitchWeapon_Force(entity e, float w)
 {
-       // don't switch to another weapon if we're not allowed to
-       if(e.weapon_forbidchange)
-               return;
-
        e.cnt = e.switchweapon;
        e.switchweapon = w;
        e.selectweapon = w;
index 6ef2bfcd0cc925397616ff34b8f8dc528896d1bd..d5ef02034cee6f21751627f27af8ae25eed9b59d 100644 (file)
@@ -210,7 +210,6 @@ void w_clear();
 void w_ready();
 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
 .float weapon_nextthink;
-.float weapon_forbidchange;
 .void() weapon_think;
 
 //float        PLAYER_WEAPONSELECTION_DELAY = );
index 5a35b137b5fc91bbc24648ae7e6371ce4b01307c..6e85e7aff695290dfd75e2a9609ea06b233b4a84 100644 (file)
@@ -104,11 +104,20 @@ void NIX_GiveCurrentWeapon()
                        Send_CSQC_Centerprint_Generic(self, CPID_NIX_WPNCHANGE, strcat("^2Active weapon: ^3", W_Name(nix_weapon)), 0, 0);
 
                weapon_action(nix_weapon, WR_RESETPLAYER);
+
                // all weapons must be fully loaded when we spawn
                entity e;
                e = get_weaponinfo(nix_weapon);
                if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                        self.weapon_load[nix_weapon] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
+
+               // nex too
+               if(autocvar_g_balance_nex_charge)
+               {
+                       if(autocvar_g_balance_nex_secondary_chargepool)
+                               self.nex_chargepool_ammo = 1;
+                       self.nex_charge = autocvar_g_balance_nex_charge_start;
+               }
        }
        if(self.nix_lastinfotime != dt)
        {
index a628be25bbd3521e14a4204cf7ee2905ff010ae5..0be80db124af3c7675ffc929ac1537d7eff9e81f 100644 (file)
@@ -201,6 +201,7 @@ void W_Hagar_Attack2_Load (void)
                        if(self.hagar_load)
                        {
                                // if we pressed primary fire while loading, unload all rockets and abort
+                               self.weaponentity.state = WS_READY;
                                W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo
                                self.hagar_load = 0;
                                sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
@@ -220,6 +221,7 @@ void W_Hagar_Attack2_Load (void)
                                if(!self.hagar_loadblock && self.hagar_loadstep < time)
                                {
                                        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo);
+                                       self.weaponentity.state = WS_INUSE;
                                        self.hagar_load += 1;
                                        sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE, ATTN_NORM);
 
@@ -242,19 +244,21 @@ void W_Hagar_Attack2_Load (void)
 
        if(self.hagar_load)
        {
-               self.weapon_forbidchange = TRUE;
                if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && !autocvar_g_balance_hagar_secondary_load_hold))
+               {
+                       self.weaponentity.state = WS_READY;
                        W_Hagar_Attack2_Load_Release();
+               }
        }
        else
        {
-               self.weapon_forbidchange = FALSE;
                self.hagar_loadbeep = FALSE;
        }
 
        // we aren't checking ammo during an attack, so we must do it here
        if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2))
        {
+               // note: this doesn't force the switch
                W_SwitchToOtherWeapon(self);
                return;
        }
@@ -302,6 +306,15 @@ float w_hagar(float req)
                        }
                }
        }
+       else if (req == WR_GONETHINK)
+       {
+               // we lost the weapon and want to prepare switching away
+               if(self.hagar_load)
+               {
+                       self.weaponentity.state = WS_READY;
+                       W_Hagar_Attack2_Load_Release();
+               }
+       }
        else if (req == WR_PRECACHE)
        {
                precache_model ("models/weapons/g_hagar.md3");
index 1ffde9fd0e0280a5d6bd2aa2346309d26c1cc7c5..3d3be3b1f6fc2c9ec1dd0c22fa9f6980fed48be9 100644 (file)
@@ -84,6 +84,7 @@ Lord Canistra
 Nikoli
 
 **Other Active Contributors
+Akari
 Ant "Antibody" Zucaro
 Antonio "terencehill" Piu
 Ben "MooKow" Banker
@@ -95,15 +96,32 @@ Florian Paul "lda17h" Schmidt
 Kristian "morfar" Johansson
 kojn
 Maik "SavageX" Merten
+Mick Rippon
 MrBougo
 Przemysław "atheros" Grzywacz
 Ruszkai "C.Brutail" Ákos
 Samual Lenks
 Severin "sev" Meyer
 Stephan "esteel" Stahl
+The player with the unnecessarily long name
 Wolfgang "Blub\0" Bumiller
 SoulKeeper_p
 
+** TODO to be verified and sorted into the categories
+atheros - CA fixes
+cortez - map changes
+Florian Paul Schmidt - g_dodging
+parasti - various fixes
+magorian - a menu text overlap issue fix
+Paul Scott - keepaway bot AI
+PlasmaSheep - worked on player voices
+Sc0rp - some of our music
+Rodrigo Mouton Laudin <ratogenesis> - Spanish translation
+Maxime Paradis <taximus.micro> - French translation (additionally to calinou)
+xaN1C4n3 - Hungarian translation
+PinkRobot and freefang - Dutch translation
+marcus256 - Swedish translation
+
 **Past Contributors
 Alexander "motorsep" Zubov
 Amos "torus" Dudley