diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-11-05 17:09:56 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-11-05 17:09:56 -0300 |
commit | 4f8f0258127ed44f4600949314740c4f04857f31 (patch) | |
tree | f652f53ea52faefad36e4ab6da0274fc56749c96 /src/map/pc.cpp | |
parent | 439ab328350c730c9f45d66e6a77b3fdd02dc786 (diff) | |
download | tmwa-4f8f0258127ed44f4600949314740c4f04857f31.tar.gz tmwa-4f8f0258127ed44f4600949314740c4f04857f31.tar.bz2 tmwa-4f8f0258127ed44f4600949314740c4f04857f31.tar.xz tmwa-4f8f0258127ed44f4600949314740c4f04857f31.zip |
Reduce scope of a variable to prevent possible exploits.
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r-- | src/map/pc.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp index dc34c96..a414857 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -3124,7 +3124,10 @@ int pc_gainexp_reason(dumb_ptr<map_session_data> sd, int base_exp, int job_exp, } // Double Xp Weekends - base_exp = (base_exp * static_cast<double>(battle_config.base_exp_rate) / 100.); + if (reason != PC_GAINEXP_REASON::SCRIPT) + base_exp = (base_exp * static_cast<double>(battle_config.base_exp_rate) / 100.); + + // Sanitization if (base_exp <= 0) base_exp = 0; else if (base_exp > 1000000000) |