fix: 修复泛型对象 player 不能判断 nil 的表达式错误
This commit is contained in:
parent
0fad0417c7
commit
4dddd1422b
|
@ -3,6 +3,7 @@ package room
|
|||
import (
|
||||
"github.com/kercylan98/minotaur/game"
|
||||
"github.com/kercylan98/minotaur/utils/concurrent"
|
||||
"github.com/kercylan98/minotaur/utils/generic"
|
||||
"github.com/kercylan98/minotaur/utils/hash"
|
||||
"sync"
|
||||
)
|
||||
|
@ -91,7 +92,7 @@ func (slf *Seat[PlayerID, P, R]) SetSeat(id PlayerID, seat int) int {
|
|||
}()
|
||||
oldSeat := slf.GetSeat(id)
|
||||
player := slf.GetPlayerWithSeat(seat)
|
||||
if player != nil {
|
||||
if generic.IsNil(player) {
|
||||
if oldSeat == NoSeat {
|
||||
maxSeat := len(slf.seatSP) - 1
|
||||
if seat > maxSeat {
|
||||
|
|
Loading…
Reference in New Issue