Skip to content

Commit

Permalink
resolve conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed May 17, 2024
1 parent ad92e23 commit 81a17a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/creatures/players/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ class Player final : public Creature, public Cylinder, public Bankable {
void addList() override;
void removePlayer(bool displayEffect, bool forced = true);

static uint64_t getExpForLevel(const uint64_t lv) {
return (((lv - 6ULL) * lv + 17ULL) * lv - 12ULL) / 6ULL * 100ULL;
static uint64_t getExpForLevel(const uint32_t level) {
return (((level - 6ULL) * level + 17ULL) * level - 12ULL) / 6ULL * 100ULL;
}

uint16_t getStaminaMinutes() const {
Expand Down
6 changes: 1 addition & 5 deletions src/lua/functions/core/game/game_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,7 @@ int GameFunctions::luaGameloadMapChunk(lua_State* L) {
int GameFunctions::luaGameGetExperienceForLevel(lua_State* L) {
// Game.getExperienceForLevel(level)
const uint32_t level = getNumber<uint32_t>(L, 1);
if (level == 0) {
lua_pushnumber(L, 0);
} else {
lua_pushnumber(L, Player::getExpForLevel(level));
}
lua_pushnumber(L, level > 0 ? Player::getExpForLevel(level) : 0);
return 1;
}

Expand Down

0 comments on commit 81a17a3

Please sign in to comment.