TTT2 icon indicating copy to clipboard operation
TTT2 copied to clipboard

Feature Request: Deactivate the drowning sound for the "no drowning damage" item

Open mexikoedi opened this issue 1 year ago • 5 comments

If someone buys the "no drowning damage" item, then the drowning sound should be disabled for this person. Otherwise, everyone will hear the sound, and this is not ideal. For example, if someone tries to hide under the water.

mexikoedi avatar Oct 22 '23 19:10 mexikoedi

We have to check if this is possible

TimGoll avatar Oct 22 '23 22:10 TimGoll

Looking at the Source sdk 2013 github, it seems there might be a boolean function we can tap into. https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/player.cpp#L1948C59-L1948C59

Spanospy avatar Oct 22 '23 22:10 Spanospy

nice catch, I'll look into it

TimGoll avatar Oct 22 '23 22:10 TimGoll

Maybe this is also needed for the other "no damage" items (fire, prop, hazard, ...)? But in my opinion it's definitely needed for the "no drowning damage" item, if it's possible.

mexikoedi avatar Oct 23 '23 13:10 mexikoedi

I experimented with this, and what I found is that:

I put code like this inside SetupMove, or Tick in both client and server, and it seems to not have an effect:

function GM:SetupMove(ply, mv, cmd)
	if IsValid(ply) and ply:HasEquipmentItem("item_ttt_nodrowningdmg") then
		ply:SetSaveValue("m_AirFinished", CurTime() + 10)
	end
end

But as of today, I don't hear the drowning noise from my own character due to the implementation.

EntranceJew avatar Dec 20 '23 13:12 EntranceJew