From 556d1cdc020c1ab1e7cd2e7bee76366311415e9a Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Mon, 25 Dec 2023 19:16:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20room=5Foptions.go?= =?UTF-8?q?=20=E4=B8=AD=E7=A9=BA=E6=8C=87=E9=92=88=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/space/room_options.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/space/room_options.go b/game/space/room_options.go index f41a8f3..a4ed557 100644 --- a/game/space/room_options.go +++ b/game/space/room_options.go @@ -34,11 +34,11 @@ func (rco *RoomControllerOptions[EntityID, RoomID, Entity, Room]) WithOwnerInher rco.ownerInheritHandler = inheritHandler[0] } else if inherit { rco.ownerInheritHandler = func(controller *RoomController[EntityID, RoomID, Entity, Room]) *EntityID { - if e := controller.GetFirstEmptySeatEntity(); e != nil { + if e := controller.GetFirstEmptySeatEntity(); !generic.IsNil(e) { var id = e.GetId() return &id } - if e := controller.GetRandomEntity(); e != nil { + if e := controller.GetRandomEntity(); !generic.IsNil(e) { var id = e.GetId() return &id }