From 905ff11095c71453becaf53562efbdf56fbf3eff Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Tue, 17 Dec 2024 16:05:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=82=80=E8=AF=B7=E5=AF=B9=E5=B1=80?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_friend.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worldsrv/action_friend.go b/worldsrv/action_friend.go index 1c304d3..9c84ae2 100644 --- a/worldsrv/action_friend.go +++ b/worldsrv/action_friend.go @@ -301,11 +301,13 @@ func (this *CSInviteFriendHandler) Process(s *netlib.Session, packetid int, data SrcHead: proto.Int32(p.Head), SrcHeadUrl: proto.String(p.HeadUrl), OpRetCode: opRetCode, - GameId: proto.Int(p.scene.gameId), - RoomId: proto.Int(p.scene.sceneId), Pos: proto.Int32(msg.GetPos()), RoleId: int32(roleId), } + if p.scene != nil { + pack.GameId = int32(p.scene.gameId) + pack.RoomId = int32(p.scene.sceneId) + } proto.SetDefaults(pack) player.SendToClient(int(friend.FriendPacketID_PACKET_SCInviteFriend), pack) logger.Logger.Trace("SCInviteFriendHandler: ", pack)