diff --git a/CHANGELOG.md b/CHANGELOG.md index f5482e4b1d..5485ae1dd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,8 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel - The level time now starts with the first preparing phase, meaning that idle on connect doesn't decrease the map time (by @TimGoll) - Minor cleanup and optimizations in weapon code (by @TW1STaL1CKY) - Now always properly checks if an entity is a true ragdoll to make sure no other props get ragdoll handling (by @TimGoll) +- Spectators are now able to look at corpses on fire (by @TimGoll) +- Corpses on fire display that information in targetID and MStack (by @TimGoll) ### Fixed diff --git a/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vmt b/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vmt new file mode 100644 index 0000000000..d36b930c80 --- /dev/null +++ b/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vmt @@ -0,0 +1,10 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/ttt/tid/tid_onfire" + "$nocull" 1 + "$nodecal" 1 + "$nolod" 1 + "$translucent" 1 + "$vertexalpha" 1 + "$vertexcolor" 1 +} diff --git a/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vtf b/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vtf new file mode 100644 index 0000000000..9fbec92610 Binary files /dev/null and b/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vtf differ diff --git a/gamemodes/terrortown/gamemode/client/cl_main.lua b/gamemodes/terrortown/gamemode/client/cl_main.lua index 80124da4d2..29cc1a12ea 100644 --- a/gamemodes/terrortown/gamemode/client/cl_main.lua +++ b/gamemodes/terrortown/gamemode/client/cl_main.lua @@ -561,7 +561,7 @@ function GM:CleanUpMap() for i = 1, #ragdolls do local ent = ragdolls[i] - if not IsValid(ent) or CORPSE.GetPlayerNick(ent, "") == "" then + if not IsValid(ent) or not ent:IsPlayerRagdoll() then continue end diff --git a/gamemodes/terrortown/gamemode/server/sv_corpse.lua b/gamemodes/terrortown/gamemode/server/sv_corpse.lua index 7ae97fd7e7..b5d0271e8b 100644 --- a/gamemodes/terrortown/gamemode/server/sv_corpse.lua +++ b/gamemodes/terrortown/gamemode/server/sv_corpse.lua @@ -258,8 +258,8 @@ function CORPSE.ShowSearch(ply, rag, isCovert, isLongRange) end -- prevent search for anyone if the body is burning - if rag:IsOnFire() then - LANG.Msg(ply, "body_burning", nil, MSG_CHAT_WARN) + if rag:IsOnFire() and ply:IsTerror() then + LANG.Msg(ply, "body_burning", nil, MSG_MSTACK_WARN) return end diff --git a/lua/ttt2/libraries/targetid.lua b/lua/ttt2/libraries/targetid.lua index d4140c32a1..dd0468f938 100644 --- a/lua/ttt2/libraries/targetid.lua +++ b/lua/ttt2/libraries/targetid.lua @@ -35,6 +35,7 @@ local materialAutoClose = Material("vgui/ttt/tid/tid_auto_close") local materialDoor = Material("vgui/ttt/tid/tid_big_door") local materialDestructible = Material("vgui/ttt/tid/tid_destructible") local materialDNATargetID = Material("vgui/ttt/dnascanner/dna_hud") +local materialFire = Material("vgui/ttt/tid/tid_onfire") --- -- This function makes sure local variables, which use other libraries that are not yet initialized, are initialized later. @@ -514,11 +515,6 @@ function targetid.HUDDrawTargetIDRagdolls(tData) return end - -- only show this if the ragdoll has a nick, else it could be a mattress - if not CORPSE.GetPlayerNick(ent, false) then - return - end - local corpse_found = CORPSE.GetFound(ent, false) or not gameloop.IsDetectiveMode() local corpse_ply = corpse_found and CORPSE.GetPlayer(ent) or false local binoculars_useable = IsValid(c_wep) and c_wep:GetClass() == "weapon_ttt_binoculars" @@ -563,6 +559,10 @@ function targetid.HUDDrawTargetIDRagdolls(tData) else tData:SetSubtitle(ParT("corpse_hint", key_params)) end + + if ent:IsOnFire() then + tData:AddDescriptionLine(TryT("body_burning"), COLOR_ORANGE, { materialFire }) + end elseif binoculars_useable then tData:SetSubtitle(ParT("corpse_binoculars", { key = Key("+attack", "ATTACK") })) else