Skip to content

Commit 65b9d2e

Browse files
committed
equipment: remove unused check about alt/original wep name
1 parent c28a48f commit 65b9d2e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

pkg/demoinfocs/datatables.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -472,27 +472,24 @@ func (p *parser) bindWeapon(entity st.Entity, wepType common.EquipmentType) {
472472
modelIndex := entity.Property("m_nModelIndex").Value().IntVal
473473
eq.OriginalString = p.modelPreCache[modelIndex]
474474

475-
wepFix := func(defaultName, altName string, alt common.EquipmentType) {
475+
wepFix := func(altName string, alt common.EquipmentType) {
476476
// Check 'altName' first because otherwise the m4a1_s is recognized as m4a4
477477
if strings.Contains(eq.OriginalString, altName) {
478478
eq.Type = alt
479-
} else if !strings.Contains(eq.OriginalString, defaultName) {
480-
// happens with POV demos, not sure why (model pre-cache not working right?)
481-
//p.setError(fmt.Errorf("unknown weapon model %q", eq.OriginalString))
482479
}
483480
}
484481

485482
switch eq.Type {
486483
case common.EqP2000:
487-
wepFix("_pist_hkp2000", "_pist_223", common.EqUSP)
484+
wepFix("_pist_223", common.EqUSP)
488485
case common.EqM4A4:
489-
wepFix("_rif_m4a1", "_rif_m4a1_s", common.EqM4A1)
486+
wepFix("_rif_m4a1_s", common.EqM4A1)
490487
case common.EqP250:
491-
wepFix("_pist_p250", "_pist_cz_75", common.EqCZ)
488+
wepFix("_pist_cz_75", common.EqCZ)
492489
case common.EqDeagle:
493-
wepFix("_pist_deagle", "_pist_revolver", common.EqRevolver)
490+
wepFix("_pist_revolver", common.EqRevolver)
494491
case common.EqMP7:
495-
wepFix("_smg_mp7", "_smg_mp5sd", common.EqMP5)
492+
wepFix("_smg_mp5sd", common.EqMP5)
496493
}
497494
}
498495

0 commit comments

Comments
 (0)