Skip to content

Commit be86e6c

Browse files
committed
common: document that Player.Entity may be nil (#170)
the player's entity is destroyed some time after his death and then re-created when he re-spawns in the next round. during this time period, Player.Entity may be nil.
1 parent 51e8831 commit be86e6c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

common/player.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ type Player struct {
3232
CurrentEquipmentValue int
3333
FreezetimeEndEquipmentValue int
3434
RoundStartEquipmentValue int
35-
ActiveWeaponID int // Used internally to set the active weapon, see ActiveWeapon()
36-
RawWeapons map[int]*Equipment // All weapons the player is currently carrying
37-
AmmoLeft [32]int // Ammo left for special weapons (e.g. grenades), index corresponds Equipment.AmmoType
38-
Entity st.IEntity
35+
ActiveWeaponID int // Used internally to set the active weapon, see ActiveWeapon()
36+
RawWeapons map[int]*Equipment // All weapons the player is currently carrying
37+
AmmoLeft [32]int // Ammo left for special weapons (e.g. grenades), index corresponds Equipment.AmmoType
38+
Entity st.IEntity // May be nil between player-death and re-spawn
3939
AdditionalPlayerInformation *AdditionalPlayerInformation // Mostly scoreboard information such as kills, deaths, etc.
4040
ViewDirectionX float32 // Yaw in degrees, 0 to 360
4141
ViewDirectionY float32 // Pitch in degrees, 270 to 90 (270=-90)

0 commit comments

Comments
 (0)