ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.84k stars 2.02k forks source link

Fix for being unable to detonate the satchel when holding a detonator (i.e. having a satchel in the world) and ready tripmine in hands. #532

Open SoDOOManiac opened 2 years ago

SoDOOManiac commented 2 years ago

With this fix the player can detonate the satchel when holding a detonator (i.e. having a satchel in the world) and ready tripmine in hands, unlike in HL2DM https://youtu.be/pvfdsDBldqI

Adrianilloo commented 3 months ago

This commit is not quite correct. The addition of !m_bDetonatorArmed subcondition at the start of the function makes the whole condition redundant and always failing since StartSatchelDetonate is only called when m_bDetonatorArmed is true, by default code (see CWeapon_SLAM::SecondaryAttack). This makes being able to detonate satchels anytime (with any undesired animation playing, ie. in the middle of a throw).

Furthermore, the choice of using throw-ready animation for the detonation during tripmine planting ready state isn't natural to me. I prefer using the "unarmed state" detonation animation.

Here is another solution, with the above issue fixed so that detonation is only allowed at "idling" states, including tripmine planting ready state.

SoDOOManiac commented 3 months ago

@Adrianilloo, thank you, it's a nice surprise to see someone cares. I hope one day I will resume working on Contingency mod (from another account of mine) and will add the fix you suggested.