ValveSoftware / halflife

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

[CS] game_player_equip HE grenade server crash #1951

Open tyftler opened 11 years ago

tyftler commented 11 years ago

If a player triggers a game_player_equip and receives a HE grenade, but already has one, you can see a small HE model falling slowly down at the point where the player is standing for about 1 or 2 seconds. If this player now moves away and another one touches this model, the server will crash.

alfred-valve commented 11 years ago

is this not related to/a dupe of #1270 ?

tyftler commented 11 years ago

No, it's another issue and has nothing to do with that.

xPaw commented 11 years ago

@alfred-valve I also sent you crash dumps via email, and a map related to this crashing issue.

LevShisterov commented 11 years ago

[proposed code change] In void CBasePlayerItem::AttachToPlayer ( CBasePlayer *pPlayer ) change pev->nextthink = gpGlobals->time + .1; to pev->nextthink = 0; SetThink( NULL ); [/proposed code change] this will prevent further attempts to materialize item, which again assign Touch which triggers second AddToPlayer, which schedule item removal and then leads to delayed crash in GetWeaponData because item is deleted while still attached to player.

This is a bug in HLSDK. It is very similar to described in topic start. There is a map for HLDM named "endcamp" with destroyable crates. When you destroy them, weapon_satchel is spawned on a height of about 60 units. If player catch them in fly - server crashes.

SamVanheer commented 5 years ago

I tested this out using a map designed to have a bot receive grenades every second. The grenade falls through a clip brush so a player can touch the grenade. I am unable to pick up the grenade as it falls, even after it has touched the ground.

Picking up a grenade and then touching the other one produces no change in behavior.

afbeelding

Note that i tested this in Condition Zero, but i doubt there is any difference in code that could affect this. The code that i checked involving the spawning, falling and touching of grenades seems to be identical.

Perhaps it was fixed and the issue was never closed, or the crash was caused by a plugin? I recommend checking the commit history for the code in question to see if anything was changed.