Fix return type for lobby functions. MAPS ARE ALREADY POINTERS.
This commit is contained in:
parent
447ea90230
commit
e55187ee11
@ -6,9 +6,9 @@ import (
|
||||
|
||||
type Lobby map[uuid.UUID]Player
|
||||
|
||||
var lobbyInstance *Lobby = nil
|
||||
var lobbyInstance Lobby = nil
|
||||
|
||||
func GetLobby() *Lobby {
|
||||
func GetLobby() Lobby {
|
||||
if lobbyInstance == nil {
|
||||
lobbyInstance = newLobby()
|
||||
}
|
||||
@ -16,9 +16,9 @@ func GetLobby() *Lobby {
|
||||
return lobbyInstance
|
||||
}
|
||||
|
||||
func newLobby() *Lobby {
|
||||
var lobby Lobby
|
||||
return &lobby
|
||||
func newLobby() Lobby {
|
||||
lobby := make(map[uuid.UUID]Player, 0)
|
||||
return lobby
|
||||
}
|
||||
|
||||
func (lobby Lobby) RegisterPlayer(player *Player) {
|
||||
|
Loading…
Reference in New Issue
Block a user