代码优化

This commit is contained in:
hahwu 2025-12-16 15:31:24 +08:00
parent 5dde9f9f9f
commit b8662c3afd

View File

@ -598,13 +598,12 @@ func GetCardInfoMsg(CardInfo *card.CardInfo) *proto.ResFriendCard {
}
ps := G_GameLogicPtr.GetSimplePlayerByUid(Uid)
name := "未知玩家"
if ps != nil {
name = ps.Name
if ps == nil {
return &proto.ResFriendCard{}
}
return &proto.ResFriendCard{
Uid: int64(Uid),
Name: name,
Name: ps.Name,
Face: int32(ps.Face),
Avatar: int32(ps.Avatar),
Level: int32(ps.Level),