邀请好友界面,Lily已经是玩家好友了,视为获得了已邀请了一位好友(后续添加其他NPC好友不计数)

This commit is contained in:
hahwu 2025-07-01 14:47:15 +08:00
parent 0c56cbd224
commit 1cc633b5ac

View File

@ -4198,6 +4198,10 @@ func ReqAddNpc(player *Player, buf []byte) error {
proto.Unmarshal(buf, req) proto.Unmarshal(buf, req)
FriendMod := player.PlayMod.getFriendMod() FriendMod := player.PlayMod.getFriendMod()
FriendMod.SetNpc(int(req.NpcId)) FriendMod.SetNpc(int(req.NpcId))
if len(FriendMod.Npc) == 1 { // 首次添加NPC 视为邀请好友成功
InviteMod := player.PlayMod.getInviteMod()
InviteMod.AddInvite(int(req.NpcId))
}
player.PlayMod.save() player.PlayMod.save()
FriendListBackData(player) FriendListBackData(player)
PlayroomMod := player.PlayMod.getPlayroomMod() PlayroomMod := player.PlayMod.getPlayroomMod()