-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grenadefixes #479
Grenadefixes #479
Conversation
В чом прекол |
3dee6bb
to
5bbba22
Compare
6ae3127
to
5bbba22
Compare
grenade can't deployed on pickup (if the player did not have a weapon) |
Hi @Vaqtincha , got one question, that hegrenade you wanted to pickup, was originally an armoury_entity or weaponbox? Because it matters, a lot In this cases of bugfixes approaches a little of context is always needed. The better communication the best, we can't guess by just looking at the code because it can involve big chains of structures and flows that can be easily broken. (so this way this will not turn into a real "circus") |
@dystopm bug only with armory_entity. on armory touch the player receives via givenameditem and CanDeploy is called before the player is filled with ammo (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]) |
And this is imperceptible when the player has any other weapon. |
I'm not understanding then. GiveNamedItem creates, Spawn assigns m_iDefaultAmmo, touching called on DefaultTouch where AddPlayerItem is called, then CBasePlayerWeapon::AddToPlayer which gives ammo on ExtractAmmo, gun is linked to player and then inside FShouldSwitchWeapon there is the first call to CanDeploy which returns true because ammo was given on ExtractAmmo/AddPrimaryAmmo. Am I forgetting something? 🤔 |
@dystopm
->AddDuplicate->ExtractAmmo->AddPrimaryAmmo->m_pPlayer->GiveAmmo ->CHalfLifeMultiplay::ShouldSwitchWeapon will return FALSE |
this is a problem with weaponbox and not armory_entity (many years have passed and I forgot) but the problem is the same (CanDeploy is called before the player gets ammo) |
Well between these 2 entity there's a huge difference. armoury_entity gives you ammo on AddWeapon (which is ExtractAmmo), it doesn't need to get into AddDuplicate chain. so this was discarded from before. Was going to ask you if you were using an edited fork or something. weaponbox gives you gun first, ammo then, but that can be fixed in two ways:
Stay tuned |
Ahahah. "A huge difference between weaponbox and armory_entity." Thanks, I didn't know. 🙃 There is no need to be smart here. I know very well how they work. |
¿? I couldn't say you know "well" how this works if you were ignoring the behavior of both entities and your proposed fix is only changing CanDeploy to "true" randomlessly. There IS a need to be smart here, what there is no need for is to be spicy. |
No description provided.