Skip to content

Commit 054bd08

Browse files
committed
fix another POV crash
1 parent 95a66fd commit 054bd08

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pkg/demoinfocs/datatables.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,10 @@ func (p *parser) bindWeaponS2(entity st.Entity) {
11041104
)
11051105

11061106
entity.Property("m_hOwnerEntity").OnUpdate(func(val st.PropertyValue) {
1107+
if val.Any == nil {
1108+
return
1109+
}
1110+
11071111
owner := p.GameState().Participants().FindByPawnHandle(val.Handle())
11081112
if owner == nil {
11091113
equipment.Owner = nil
@@ -1142,7 +1146,14 @@ func (p *parser) bindWeaponS2(entity st.Entity) {
11421146
return
11431147
}
11441148

1145-
shooter := p.GameState().Participants().FindByPawnHandle(entity.PropertyValueMust("m_hOwnerEntity").Handle())
1149+
ownerHandleVal := entity.PropertyValueMust("m_hOwnerEntity")
1150+
1151+
var shooter *common.Player
1152+
1153+
if ownerHandleVal.Any != nil {
1154+
shooter = p.GameState().Participants().FindByPawnHandle(ownerHandleVal.Handle())
1155+
}
1156+
11461157
if shooter == nil {
11471158
shooter = equipment.Owner
11481159
}

0 commit comments

Comments
 (0)