Skip to content

Commit

Permalink
fix: defense spawn when op is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
redraskal committed Jul 22, 2024
1 parent d672963 commit 1740384
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dissect/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ func readSpawn(r *Reader) error {
formatted := strings.Replace(location, "<br/>", ", ", 1)
log.Debug().Str("site", formatted).Msg("defense site")
for i, p := range r.Header.Players {
if r.Header.Teams[p.TeamIndex].Role == Defense || (p.Operator != Recruit && p.Operator.Role() == Defense) {
defenseTeam := r.Header.Teams[p.TeamIndex].Role == Defense
defenseRole := p.Operator != Recruit && p.Operator != 0 && p.Operator.Role() == Defense
if defenseTeam || defenseRole {
r.Header.Players[i].Spawn = formatted
}
}
Expand Down

0 comments on commit 1740384

Please sign in to comment.