diff --git a/garrysmod/gamemodes/terrortown/gamemode/cl_hudpickup.lua b/garrysmod/gamemodes/terrortown/gamemode/cl_hudpickup.lua index da656b7f96..61b4899e3c 100644 --- a/garrysmod/gamemodes/terrortown/gamemode/cl_hudpickup.lua +++ b/garrysmod/gamemodes/terrortown/gamemode/cl_hudpickup.lua @@ -15,10 +15,9 @@ local pickupclr = { } function GM:HUDWeaponPickedUp( wep ) - local client = LocalPlayer() - if (not IsValid(client)) or (not client:Alive()) then return end + if (not IsValid(wep)) or (not LocalPlayer():Alive()) then return end - local name = LANG.TryTranslation(wep.GetPrintName and wep:GetPrintName() or "Unknown Weapon Name") + local name = LANG.TryTranslation(wep.GetPrintName and wep:GetPrintName() or wep:GetClass() or "Unknown Weapon Name") local pickup = {} pickup.time = CurTime() @@ -49,7 +48,7 @@ end function GM:HUDItemPickedUp( itemname ) - if not LocalPlayer():Alive() then return end + if (not LocalPlayer():Alive()) then return end local pickup = {} pickup.time = CurTime() @@ -79,7 +78,7 @@ function GM:HUDItemPickedUp( itemname ) end function GM:HUDAmmoPickedUp( itemname, amount ) - if (not IsValid(LocalPlayer())) or (not LocalPlayer():Alive()) then return end + if (not LocalPlayer():Alive()) then return end local itemname_trans = LANG.TryTranslation(string.lower("ammo_" .. itemname)) @@ -126,7 +125,7 @@ end function GM:HUDDrawPickupHistory() - if (self.PickupHistory == nil) then return end + if (not self.PickupHistory) then return end local x, y = ScrW() - self.PickupHistoryWide - 20, self.PickupHistoryTop local tall = 0