load deck warning

This commit is contained in:
stryan 2021-11-19 16:39:02 -05:00
parent 88c66f455c
commit 7447fc8a59

View File

@ -95,6 +95,10 @@ func (s *Session) LoadDeck(id uuid.UUID, data string) SessionResp {
log.Printf("%v attempted to load invalid deck: %v", id, data) log.Printf("%v attempted to load invalid deck: %v", id, data)
return SessionRespLoadDeckError return SessionRespLoadDeckError
} }
if s.Game == nil {
log.Println("attmpted to load deck before game created")
return SessionRespError
}
if id == s.p1 { if id == s.p1 {
s.p1Deck = deck s.p1Deck = deck
s.Game.SentinalDeck = LoadDeck(SentinalID, s.p1Deck) s.Game.SentinalDeck = LoadDeck(SentinalID, s.p1Deck)