From 2bf2904844e4addcfcbab6f2b1091a359c68a3c4 Mon Sep 17 00:00:00 2001 From: letheriver2007 Date: Mon, 21 Apr 2025 22:11:14 +0800 Subject: [PATCH] fix: trial avatar cannot enter battle --- Common/Data/Excel/AvatarConfigExcel.cs | 1 + GameServer/Game/Battle/SceneSkillManager.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Common/Data/Excel/AvatarConfigExcel.cs b/Common/Data/Excel/AvatarConfigExcel.cs index 52b57de4..5d5a737f 100644 --- a/Common/Data/Excel/AvatarConfigExcel.cs +++ b/Common/Data/Excel/AvatarConfigExcel.cs @@ -15,6 +15,7 @@ public class AvatarConfigExcel : ExcelResource [JsonIgnore] public List SkillTree = []; public int AvatarID { get; set; } = 0; + public int AdventurePlayerID { get; set; } public HashName AvatarName { get; set; } = new(); public int ExpGroup { get; set; } = 0; public int MaxPromotion { get; set; } = 0; diff --git a/GameServer/Game/Battle/SceneSkillManager.cs b/GameServer/Game/Battle/SceneSkillManager.cs index 046a7368..4ef99523 100644 --- a/GameServer/Game/Battle/SceneSkillManager.cs +++ b/GameServer/Game/Battle/SceneSkillManager.cs @@ -63,7 +63,8 @@ public class SceneSkillManager(PlayerInstance player) : BasePlayerManager(player return GameData.AdventureAbilityConfigListData.GetValueOrDefault(monster.MonsterData.ID); if (entity is AvatarSceneInfo avatar) - return GameData.AdventureAbilityConfigListData.GetValueOrDefault(avatar.AvatarInfo.GetAvatarId()); + if (GameData.AvatarConfigData.TryGetValue(avatar.AvatarInfo.GetAvatarId(), out var excel)) + return GameData.AdventureAbilityConfigListData.GetValueOrDefault(excel.AdventurePlayerID); return null; }