Skip to content

Commit b03a912

Browse files
authored
Corpse: On Fire Feedback (TTT-2#1551)
- added "corpse on fire" to targetID when looking at a corpse - moved the warning message when trying to inspect from chat to mstack - allow spectators to look at burning corpses - cleanup of missing `IsPlayerRagdoll` calls
1 parent 08e1e58 commit b03a912

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
6363
- The level time now starts with the first preparing phase, meaning that idle on connect doesn't decrease the map time (by @TimGoll)
6464
- Minor cleanup and optimizations in weapon code (by @TW1STaL1CKY)
6565
- Now always properly checks if an entity is a true ragdoll to make sure no other props get ragdoll handling (by @TimGoll)
66+
- Spectators are now able to look at corpses on fire (by @TimGoll)
67+
- Corpses on fire display that information in targetID and MStack (by @TimGoll)
6668

6769
### Fixed
6870

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"UnlitGeneric"
2+
{
3+
"$basetexture" "vgui/ttt/tid/tid_onfire"
4+
"$nocull" 1
5+
"$nodecal" 1
6+
"$nolod" 1
7+
"$translucent" 1
8+
"$vertexalpha" 1
9+
"$vertexcolor" 1
10+
}
Binary file not shown.

gamemodes/terrortown/gamemode/client/cl_main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ function GM:CleanUpMap()
561561
for i = 1, #ragdolls do
562562
local ent = ragdolls[i]
563563

564-
if not IsValid(ent) or CORPSE.GetPlayerNick(ent, "") == "" then
564+
if not IsValid(ent) or not ent:IsPlayerRagdoll() then
565565
continue
566566
end
567567

gamemodes/terrortown/gamemode/server/sv_corpse.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ function CORPSE.ShowSearch(ply, rag, isCovert, isLongRange)
258258
end
259259

260260
-- prevent search for anyone if the body is burning
261-
if rag:IsOnFire() then
262-
LANG.Msg(ply, "body_burning", nil, MSG_CHAT_WARN)
261+
if rag:IsOnFire() and ply:IsTerror() then
262+
LANG.Msg(ply, "body_burning", nil, MSG_MSTACK_WARN)
263263

264264
return
265265
end

lua/ttt2/libraries/targetid.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ local materialAutoClose = Material("vgui/ttt/tid/tid_auto_close")
3535
local materialDoor = Material("vgui/ttt/tid/tid_big_door")
3636
local materialDestructible = Material("vgui/ttt/tid/tid_destructible")
3737
local materialDNATargetID = Material("vgui/ttt/dnascanner/dna_hud")
38+
local materialFire = Material("vgui/ttt/tid/tid_onfire")
3839

3940
---
4041
-- 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)
514515
return
515516
end
516517

517-
-- only show this if the ragdoll has a nick, else it could be a mattress
518-
if not CORPSE.GetPlayerNick(ent, false) then
519-
return
520-
end
521-
522518
local corpse_found = CORPSE.GetFound(ent, false) or not gameloop.IsDetectiveMode()
523519
local corpse_ply = corpse_found and CORPSE.GetPlayer(ent) or false
524520
local binoculars_useable = IsValid(c_wep) and c_wep:GetClass() == "weapon_ttt_binoculars"
@@ -563,6 +559,10 @@ function targetid.HUDDrawTargetIDRagdolls(tData)
563559
else
564560
tData:SetSubtitle(ParT("corpse_hint", key_params))
565561
end
562+
563+
if ent:IsOnFire() then
564+
tData:AddDescriptionLine(TryT("body_burning"), COLOR_ORANGE, { materialFire })
565+
end
566566
elseif binoculars_useable then
567567
tData:SetSubtitle(ParT("corpse_binoculars", { key = Key("+attack", "ATTACK") }))
568568
else

0 commit comments

Comments
 (0)