diff --git a/source/server/entities/powerups.qc b/source/server/entities/powerups.qc index f933993..e8a6b19 100644 --- a/source/server/entities/powerups.qc +++ b/source/server/entities/powerups.qc @@ -523,32 +523,41 @@ float() PU_CarpenterRequirement = // void() PU_MaxAmmo = { + entity players; entity tempe; - tempe = find(world, classname, "player"); + players = find(world, classname, "player"); - while(tempe) { + while(players) { - if (!tempe.downed) { + if (!players.downed) { // Fill all weapons for (float i = 0; i < MAX_PLAYER_WEAPONS; i++) { - tempe.weapons[i].weapon_reserve = getWeaponAmmo(tempe.weapons[i].weapon_id); + players.weapons[i].weapon_reserve = getWeaponAmmo(players.weapons[i].weapon_id); } // Give Grenades - tempe.primary_grenades = 4; + players.primary_grenades = 4; // Give Betties - if (tempe.grenades & 2) tempe.secondary_grenades = 2; + if (players.grenades & 2) players.secondary_grenades = 2; } else { // Reset shots fired, fill 2 mags into reserve. - tempe.teslacount = 0; - tempe.currentammo = getWeaponMag(tempe.weapon) * 2; + players.teslacount = 0; + players.weapons[0].weapon_reserve = getWeaponMag(players.weapon) * 2; } + // Force the player to reload if their mag is empty + if (players.weapons[0].weapon_magazine == 0 || players.weapons[0].weapon_magazine_left == 0) { + tempe = self; + self = players; + W_Reload(S_BOTH); + self = tempe; + } + // MAX AMMO! text #ifdef FTE - ScrollText("MAX AMMO!", tempe); + ScrollText("MAX AMMO!", players); #else @@ -556,7 +565,7 @@ void() PU_MaxAmmo = #endif // FTE - tempe = find(tempe, classname, "player"); + players = find(players, classname, "player"); } }; diff --git a/source/server/utilities/weapon_utilities.qc b/source/server/utilities/weapon_utilities.qc index eb799fa..59413f9 100644 --- a/source/server/utilities/weapon_utilities.qc +++ b/source/server/utilities/weapon_utilities.qc @@ -181,7 +181,7 @@ void (float animation_type, void(optional float t) end_function, float playback_ break; } - self.reload_delay2 = self.fire_delay2 = self.reload_delay = self.fire_delay = self.knife_delay = time + duration + 0.2; + self.reload_delay2 = self.fire_delay2 = self.reload_delay = self.fire_delay = self.knife_delay = time + duration; UpdateVmodel(self.weaponmodel, GetWepSkin(self.weapon)); self.weapon2model = GetWeapon2Model(self.weapon); diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index e7da6d8..58a36c3 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -94,7 +94,7 @@ void() ReturnWeaponModel = UpdateV2model(self.weapon2model, GetWepSkin(self.weapon)); // Always try to reload after any action. - if (self.weapons[0].weapon_magazine == 0 && self.weapons[0].weapon_reserve != 0) + if ((self.weapons[0].weapon_magazine == 0 || self.weapons[0].weapon_magazine_left == 0) && self.weapons[0].weapon_reserve != 0) W_Reload(S_BOTH); // If the person is swapping, play the sprint anim if they're sprinting after swap. Otherwise it plays idle