File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -387,23 +387,23 @@ func (p *Parser) bindWeapon(event st.EntityCreatedEvent) {
387387 wepFix := func (ok string , change string , changer func ()) {
388388 event .Entity .FindProperty ("m_nModelIndex" ).RegisterPropertyUpdateHandler (func (val st.PropValue ) {
389389 eq .OriginalString = p .modelPreCache [val .IntVal ]
390- if strings .Contains (eq .OriginalString , ok ) {
391- // That's already ok!
392- } else if strings .Contains (eq .OriginalString , change ) {
390+ // Check 'change' first because otherwise the m4a1_s is recognized as m4a4
391+ if strings .Contains (eq .OriginalString , change ) {
393392 changer ()
394- } else {
393+ } else if ! strings . Contains ( eq . OriginalString , ok ) {
395394 panic (fmt .Sprintf ("Unknown weapon model %q" , eq .OriginalString ))
396395 }
397396 })
398397 }
399398
400- // FIXME: Deag/R8???
401399 switch eq .Weapon {
402400 case common .EqP2000 :
403401 wepFix ("_pist_hkp2000" , "_pist_223" , func () { eq .Weapon = common .EqUSP })
404402 case common .EqM4A4 :
405403 wepFix ("_rif_m4a1" , "_rif_m4a1_s" , func () { eq .Weapon = common .EqM4A1 })
406404 case common .EqP250 :
407405 wepFix ("_pist_p250" , "_pist_cz_75" , func () { eq .Weapon = common .EqCZ })
406+ case common .EqDeagle :
407+ wepFix ("_pist_deagle" , "_pist_revolver" , func () { eq .Weapon = common .EqRevolver })
408408 }
409409}
You can’t perform that action at this time.
0 commit comments