File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -278,8 +278,12 @@ func (p *parser) bindNewPlayer(playerEntity st.Entity) {
278278 playerEntity .Property ("m_bSpottedByMask.001" ).OnUpdate (spottersChanged )
279279 }
280280
281- if isNew && pl .SteamID64 != 0 {
282- p .eventDispatcher .Dispatch (events.PlayerConnect {Player : pl })
281+ if isNew {
282+ if pl .SteamID64 != 0 {
283+ p .eventDispatcher .Dispatch (events.PlayerConnect {Player : pl })
284+ } else {
285+ p .eventDispatcher .Dispatch (events.BotConnect {Player : pl })
286+ }
283287 }
284288}
285289
Original file line number Diff line number Diff line change @@ -408,11 +408,16 @@ type PlayerHurt struct {
408408 HitGroup HitGroup
409409}
410410
411- // PlayerConnect signals that a player has started connecting .
411+ // PlayerConnect signals that a player connected .
412412type PlayerConnect struct {
413413 Player * common.Player
414414}
415415
416+ // BotConnect signals that a bot has connected.
417+ type BotConnect struct {
418+ Player * common.Player
419+ }
420+
416421// PlayerDisconnected signals that a player has disconnected.
417422type PlayerDisconnected struct {
418423 Player * common.Player
You can’t perform that action at this time.
0 commit comments