From 25cfbf30a23ed1412042eb23b9f57fbfba5bff36 Mon Sep 17 00:00:00 2001 From: hahwu <31872165+hahwu@users.noreply.github.com> Date: Tue, 3 Feb 2026 17:20:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E6=B6=88=E6=81=AFbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/game/GameLogic.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/server/game/GameLogic.go b/src/server/game/GameLogic.go index d0bdf407..0f077a53 100644 --- a/src/server/game/GameLogic.go +++ b/src/server/game/GameLogic.go @@ -429,11 +429,13 @@ func (ad *GameLogic) GetResFriendPlayerByUid(Id int) *msg.ResFriendPlayerSimple return nil } } - LastActLog := player.ActLog - Last := &msg.ActLog{ - Type: int32(LastActLog.Type), - Time: LastActLog.Time, - Param: LastActLog.Param, + last := &msg.ActLog{} + if player.ActLog != nil { + last = &msg.ActLog{ + Type: int32(player.ActLog.Type), + Time: player.ActLog.Time, + Param: player.ActLog.Param, + } } return &msg.ResFriendPlayerSimple{ Uid: int64(player.Uid), @@ -450,7 +452,7 @@ func (ad *GameLogic) GetResFriendPlayerByUid(Id int) *msg.ResFriendPlayerSimple DressSet: GoUtil.MapIntToInt32(player.DressSet), Friend: GoUtil.IntToInt32(player.Friend), Physiology: GoUtil.MapIntToInt32(player.Physiology), - Last: Last, + Last: last, PetName: player.PetName, } }