diff --git a/CHANGELOG.md b/CHANGELOG.md index cf4abaa51..1c00433cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel - Fixed the shop search breaking when using certain special characters (by @NickCloudAT) - Fixed propspec not working (by @wgetJane) - Fixed a regression in TTT voice chat team colors (see ) +- Fixed ghost viewmodels briefly appearing from weapons held by other players (by @TW1STaL1CKY) ## [v0.14.3b](https://github.com/TTT-2/TTT2/tree/v0.14.3b) (2025-03-18) diff --git a/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua b/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua index 75a501f28..e048ca144 100644 --- a/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua +++ b/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua @@ -885,6 +885,11 @@ if CLIENT then -- affects @{GM:PostDrawViewModel} -- @realm client hook.Add("PreDrawViewModel", "TTT2ViewModelHider", function(viewModel, ply, wep) + -- safeguard for ghost viewmodels appearing from weapons held by other players + if wep ~= ply:GetActiveWeapon() then + return true + end + -- note: while ShowDefaultViewModel is set to true in the weapon base, addons such as TFA -- do not use the weapon base and only implement parts of it to work with TTT. In a perfect -- world TFA would be updated to fix this issue, but we can also prevent it by explicitly