fix:邀请对局空指针异常

This commit is contained in:
sk 2024-12-17 16:05:17 +08:00
parent 59f772c519
commit 905ff11095
1 changed files with 4 additions and 2 deletions

View File

@ -301,11 +301,13 @@ func (this *CSInviteFriendHandler) Process(s *netlib.Session, packetid int, data
SrcHead: proto.Int32(p.Head), SrcHead: proto.Int32(p.Head),
SrcHeadUrl: proto.String(p.HeadUrl), SrcHeadUrl: proto.String(p.HeadUrl),
OpRetCode: opRetCode, OpRetCode: opRetCode,
GameId: proto.Int(p.scene.gameId),
RoomId: proto.Int(p.scene.sceneId),
Pos: proto.Int32(msg.GetPos()), Pos: proto.Int32(msg.GetPos()),
RoleId: int32(roleId), RoleId: int32(roleId),
} }
if p.scene != nil {
pack.GameId = int32(p.scene.gameId)
pack.RoomId = int32(p.scene.sceneId)
}
proto.SetDefaults(pack) proto.SetDefaults(pack)
player.SendToClient(int(friend.FriendPacketID_PACKET_SCInviteFriend), pack) player.SendToClient(int(friend.FriendPacketID_PACKET_SCInviteFriend), pack)
logger.Logger.Trace("SCInviteFriendHandler: ", pack) logger.Logger.Trace("SCInviteFriendHandler: ", pack)