ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.68k stars 623 forks source link

[BUG] Spam defuse if defusing from air #294

Open MPNumB opened 11 years ago

MPNumB commented 11 years ago

Whenever a person isn't on ground and attempts to defuse a bomb, it spams the long and the defuse sound.

I'd recommend to block defuse start if person is in air.

MrSchism commented 11 years ago

I assume that you're referring to CS1.6.

MPNumB commented 11 years ago

Yes.

MrSchism commented 11 years ago

Which OS are you encountering this on? As well, what OSes are you aware of it happening on?

MPNumB commented 11 years ago

It was like that for ever and works on every OS. You spam defuse start. A first thing what shots in my head is: join a server with a friend, ask him to plant the bomb, set gravity to 0, type this in console "-duck;wait;+duck;wait;-duck", so you will get up from ground, aim towards the bomb and hold your use key. Now enjoy spamming the logs and defuse sound.

I'm aware of it happening on LINUX and windows servers. I'm personally am using windows XP. Not that it makes a difference though...

Check this out: https://github.com/Arkshine/CSSDK/blob/master/dlls/ggrenade.cpp As you can see, there's no onground check in C4 start use function (from line 906 to line 979). A simple way to fix this glitch is to replace line 917 to:

if( pPlayer->m_iTeam == TEAM_CT && pPlayer->pev->flags & FL_ONGROUND )