Skip to content

Commit 9afc0bb

Browse files
authored
Fixed Hud error on pickup (#1781)
This fixes Hud errors when picking up an item or weapon with no viable icon by falling back to the item_special icon Fixes #1728
1 parent 2b5d2e7 commit 9afc0bb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
1717
### Fixed
1818

1919
- Fixed new outlines' `OUTLINE_MODE_VISIBLE` and `OUTLINE_MODE_BOTH`
20+
- Fixed Hud errors when picking up items or weapons with no viable icon (by @NickCloudAT)
2021

2122
## [v0.14.1b](https://github.com/TTT-2/TTT2/tree/v0.14.1b) (2025-02-01)
2223

gamemodes/terrortown/gamemode/shared/hud_elements/tttpickup/pure_skin_pickup.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ if CLIENT then
8585
icon = self.icon_ammo
8686
end
8787

88+
-- Some items, like default HL2 items, have no icon. Fallback to the "icon_special"
89+
if icon == nil then
90+
icon = self.icon_item
91+
end
92+
8893
-- Draw the colour tip
8994
surface.SetDrawColor(tipColor.r, tipColor.g, tipColor.b, alpha)
9095
surface.DrawRect(x, y, self.tipsize, h)

0 commit comments

Comments
 (0)