File tree 5 files changed +289
-285
lines changed
5 files changed +289
-285
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,11 @@ type PlayerInfo struct {
29
29
}
30
30
31
31
type Player struct {
32
- Name string
32
+ EntityId int
33
33
SteamId int64
34
+ Name string
35
+ IsBot bool
34
36
Position r3.Vector
35
- EntityId int
36
37
Hp int
37
38
Armor int
38
39
LastAlivePosition r3.Vector
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ type WeaponFiredEvent struct {
87
87
}
88
88
89
89
type NadeEventIf interface {
90
- dummy ()
90
+ dummyNade ()
91
91
}
92
92
93
93
// Nade exploded
@@ -98,7 +98,7 @@ type NadeEvent struct {
98
98
}
99
99
100
100
// Make NadeEvents implement NadeEventIf
101
- func (NadeEvent ) dummy () {}
101
+ func (NadeEvent ) dummyNade () {}
102
102
103
103
type HeExplodedEvent struct {
104
104
NadeEvent
@@ -138,15 +138,15 @@ type PlayerFlashedEvent struct {
138
138
}
139
139
140
140
type BombEventIf interface {
141
- dummy ()
141
+ dummyBomb ()
142
142
}
143
143
144
144
type BombEvent struct {
145
145
Player * common.Player
146
146
Site rune
147
147
}
148
148
149
- func (BombEvent ) dummy () {}
149
+ func (BombEvent ) dummyBomb () {}
150
150
151
151
type BombBeginPlant struct {
152
152
BombEvent
Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ func (p *Parser) Participants() []*common.Player {
56
56
func (p * Parser ) PlayingParticipants () []* common.Player {
57
57
r := make ([]* common.Player , 0 , len (p .connectedPlayers ))
58
58
for _ , ptcp := range p .connectedPlayers {
59
- if ptcp .Team != common .Team_Spectators {
59
+ // FIXME: Why do we have to check for nil here???
60
+ if ptcp != nil && ptcp .Team != common .Team_Spectators {
60
61
r = append (r , ptcp )
61
62
}
62
63
}
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ func (p *Parser) ParseNextTick() bool {
76
76
77
77
pl .Name = rp .Name
78
78
pl .SteamId = rp .XUID
79
+ pl .IsBot = rp .IsFakePlayer
79
80
pl .AdditionalPlayerInformation = & p .additionalPlayerInfo [pl .EntityId ]
80
81
81
82
if pl .IsAlive () {
You can’t perform that action at this time.
0 commit comments