steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

[CS/CZ] Stripping player weapons leaves hasPrimary offset on true

Open xPaw opened this issue 13 years ago • 4 comments

In CBasePlayer::RemoveAllItems, it should set m_fHasPrimary to false. Without changing this, player won't be able to pickup primary weapons from armoury_entity entity, weaponbox remains working.

xPaw avatar Jan 31 '13 12:01 xPaw

Can you provide a way to reproduce this issue (nice clear steps please) so I can confirm any fixes we make.

alfred-valve avatar Jan 31 '13 17:01 alfred-valve

It is hard to reproduce without any addon like AmxModX, would require an aim map with armoury_entity on the ground, and a player_weaponstrip entity somewhere in map then you could notice that if you touch the strip entity while carrying a primary weapon, you can't pickup anymore a armoury_entity (works fine with weaponbox entities).

This is about a CBasePlayer private data (BOOL i think, amxx scripter call it m_fHasPrimary) that is checked when a player touch an armoury_entity so in CArmoury::ArmouryTouch, and if that armoury is not an item or a nade. That private data is set to FALSE in CBasePlayer::DropPlayerItem and in CBasePlayer::DropShield, i don't think anywhere else, so when CBasePlayer::RemoveAllItems is called, CBasePlayerItem::Drop is called for each weapon player is carrying and that private data is not set to 0.

If i find a map that allows to reproduce the bug, will tell you for sure.

ConnorMcLeod avatar Feb 01 '13 11:02 ConnorMcLeod

How will we notice if it got fixed?

tyftler avatar Feb 14 '13 21:02 tyftler

You follow the link to https://github.com/ValveSoftware/halflife/issues/1 :)

johndrinkwater avatar Feb 14 '13 22:02 johndrinkwater