]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Apply a hack to fix being unable to switch weapons while dead in overkill, while...
authorMario <mario@smbclan.net>
Sat, 12 Mar 2016 05:59:02 +0000 (15:59 +1000)
committerMario <mario@smbclan.net>
Sat, 12 Mar 2016 05:59:02 +0000 (15:59 +1000)
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/server/cl_impulse.qc

index 2dc6e841446f54ddaa9939ddc153eda930bf6142..125025f205c40f8ce1908705ff831df50d18a252 100644 (file)
@@ -188,7 +188,6 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
                if(self.ok_lastwep == WEP_RPC.m_id)
                        newwep = WEP_VORTEX;
                PS(self).m_switchweapon = newwep;
-               LOG_INFO("Overkill PlayerPreThink weapon setting at time ", ftos(time), "\n");
                self.ok_lastwep = 0;
        }
 
@@ -257,6 +256,10 @@ MUTATOR_HOOKFUNCTION(ok, PlayerSpawn)
        else
                self.ok_use_ammocharge = 0;
 
+       // if player changed their weapon while dead, don't switch to their death weapon
+       if(self.impulse)
+               self.ok_lastwep = 0;
+
        self.ok_pauseregen_finished = time + 2;
 
        return false;
index 47c5354c6942c39b409a14b91b1bb643d89bbfea..926eeacea5e2f4303d79f1682de98bcc4b62d3f1 100644 (file)
@@ -58,7 +58,6 @@
                        this.impulse = IMP_weapon_group_##slot.impulse; \
                        return; \
                } \
-               LOG_INFO("PlayerPostThink impulse setting at time ", ftos(time), "\n"); \
                W_NextWeaponOnImpulse(slot); \
        }
 X(1)
@@ -87,7 +86,6 @@ X(0)
                noref int prev = -1; \
                noref int best =  0; \
                noref int next = +1; \
-               LOG_INFO("Setting weapon by cycle\n"); \
                W_CycleWeapon(this.cvar_cl_weaponpriorities[slot], dir); \
        }
 X(0, prev)
@@ -135,7 +133,6 @@ X(9, next)
                        this.impulse = IMP_weapon_byid_##i.impulse; \
                        return; \
                } \
-               LOG_INFO("Setting weapon by ID\n"); \
                W_SwitchWeapon(Weapons_from(WEP_FIRST + i)); \
        }
 X(0)
@@ -172,7 +169,6 @@ IMPULSE(weapon_next_byid)
                this.impulse = IMP_weapon_next_byid.impulse;
                return;
        }
-       LOG_INFO("Setting next by ID\n");
        W_NextWeapon(0);
 }
 
@@ -184,7 +180,6 @@ IMPULSE(weapon_prev_byid)
                this.impulse = IMP_weapon_prev_byid.impulse;
                return;
        }
-       LOG_INFO("Setting prev by ID\n");
        W_PreviousWeapon(0);
 }
 
@@ -196,7 +191,6 @@ IMPULSE(weapon_next_bygroup)
                this.impulse = IMP_weapon_next_bygroup.impulse;
                return;
        }
-       LOG_INFO("Setting next by group\n");
        W_NextWeapon(1);
 }
 
@@ -208,7 +202,6 @@ IMPULSE(weapon_prev_bygroup)
                this.impulse = IMP_weapon_prev_bygroup.impulse;
                return;
        }
-       LOG_INFO("Setting prev by group\n");
        W_PreviousWeapon(1);
 }
 
@@ -220,7 +213,6 @@ IMPULSE(weapon_next_bypriority)
                this.impulse = IMP_weapon_next_bypriority.impulse;
                return;
        }
-       LOG_INFO("Setting next by priority\n");
        W_NextWeapon(2);
 }
 
@@ -232,7 +224,6 @@ IMPULSE(weapon_prev_bypriority)
                this.impulse = IMP_weapon_prev_bypriority.impulse;
                return;
        }
-       LOG_INFO("Setting prev by priority\n");
        W_PreviousWeapon(2);
 }