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)