Fix player AdvanceSkill method crash (#309)

Co-authored-by: iThorgrim <125808072+iThorgrim@users.noreply.github.com>
This commit is contained in:
kissingers
2025-09-08 16:11:16 +08:00
committed by GitHub
parent 9be4ef5485
commit 44f1f1f71b

View File

@@ -3087,12 +3087,12 @@ namespace LuaPlayer
{
uint32 _skillId = Eluna::CHECKVAL<uint32>(L, 2);
uint32 _step = Eluna::CHECKVAL<uint32>(L, 3);
if (_skillId && _step)
bool success = false;
if (_skillId && _step && player->HasSkill(_skillId))
{
if (player->HasSkill(_skillId))
Eluna::Push(L, player->UpdateSkill(_skillId, _step));
success = player->UpdateSkill(_skillId, _step);
}
Eluna::Push(L, false);
Eluna::Push(L, success);
return 1;
}