From 8579828ca6c9d2d662f39859adc132c652225a48 Mon Sep 17 00:00:00 2001 From: Exynox Date: Mon, 11 Mar 2024 18:08:24 +0200 Subject: [PATCH] Implemented official level update fix --- README.md | 1 + src/game/src/char.cpp | 2 +- src/game/src/questlua_pc.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1419029..d6408c2 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ This is a very serious security risk and one of the reasons this project is stil ### Gameplay - Fixed invisibility bug on login/respawn/teleport etc. +- Fixed player level not updating [(thread)](https://metin2.dev/topic/30612-official-level-update-fix-reversed/) ### Exploits - See the warning above :( diff --git a/src/game/src/char.cpp b/src/game/src/char.cpp index 31b0ba2..3b44242 100644 --- a/src/game/src/char.cpp +++ b/src/game/src/char.cpp @@ -5851,7 +5851,7 @@ void CHARACTER::ResetPoint(int iLv) { BYTE bJob = GetJob(); - PointChange(POINT_LEVEL, iLv - GetLevel()); + PointChange(POINT_LEVEL, iLv - GetLevel(), false, true); SetRealPoint(POINT_ST, JobInitialPoints[bJob].st); SetPoint(POINT_ST, GetRealPoint(POINT_ST)); diff --git a/src/game/src/questlua_pc.cpp b/src/game/src/questlua_pc.cpp index 3d0e3a8..d7c2f64 100644 --- a/src/game/src/questlua_pc.cpp +++ b/src/game/src/questlua_pc.cpp @@ -862,7 +862,7 @@ namespace quest ch->PointChange(POINT_SUB_SKILL, newLevel < 10 ? 0 : newLevel - std::max(ch->GetLevel(), 9)); ch->PointChange(POINT_STAT, ((std::clamp(newLevel, 1, 90) - ch->GetLevel()) * 3) + ch->GetPoint(POINT_LEVEL_STEP)); //·ış§ - ch->PointChange(POINT_LEVEL, newLevel - ch->GetLevel()); + ch->PointChange(POINT_LEVEL, newLevel - ch->GetLevel(), false, true); //HP, SP ch->SetRandomHP((newLevel - 1) * Random::get(JobInitialPoints[ch->GetJob()].hp_per_lv_begin, JobInitialPoints[ch->GetJob()].hp_per_lv_end)); ch->SetRandomSP((newLevel - 1) * Random::get(JobInitialPoints[ch->GetJob()].sp_per_lv_begin, JobInitialPoints[ch->GetJob()].sp_per_lv_end));