Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-Chara committed Feb 18, 2024
1 parent 19d0229 commit 7e71f3a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/game/server/gamecontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ IGameController::IGameController(class CGameContext *pGameServer)
m_GameOverTick = -1;
m_RoundStarted = false;
m_GrenadeLimit = 0;
m_RoundCount = 0;

m_SuddenDeath = 0;
m_aTeamscore[TEAM_RED] = m_aTeamscore[TEAM_BLUE] = 0;
Expand Down Expand Up @@ -540,7 +541,7 @@ void IGameController::Snap(int SnappingClient)
pGameInfoObj->m_TimeLimit = g_Config.m_SvTimelimit;

pGameInfoObj->m_RoundNum = (str_length(g_Config.m_SvMaprotation) && g_Config.m_SvRoundsPerMap) ? g_Config.m_SvRoundsPerMap : 0;
pGameInfoObj->m_RoundCurrent = 0;
pGameInfoObj->m_RoundCurrent = m_RoundCount + 1;

CNetObj_GameData *pGameDataObj = (CNetObj_GameData *)Server()->SnapNewItem(NETOBJTYPE_GAMEDATA, 0, sizeof(CNetObj_GameData));
if (!pGameDataObj)
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void CPlayer::Tick()
{
m_AccData.m_Money++;
m_AccData.m_Exp -= ExpNeedToNextLvl();
m_AccData.m_Level++;
m_AccData.m_Level += m_AccData.m_Level/4;
if (m_AccData.m_Exp < m_AccData.m_Level)
{
if (m_AccData.m_UserID)
Expand Down
12 changes: 8 additions & 4 deletions src/game/server/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,14 @@ class CPlayer
class CAccount *m_pAccount;
int ExpNeedToNextLvl()
{
if (m_AccData.m_Level >= 50) return m_AccData.m_Level * 20;
else if (m_AccData.m_Level >= 30) return m_AccData.m_Level * 15;
else if (m_AccData.m_Level >= 20) return m_AccData.m_Level * 12;
else if (m_AccData.m_Level >= 10) return m_AccData.m_Level * 11;
if (m_AccData.m_Level >= 50)
return m_AccData.m_Level * 20;
else if (m_AccData.m_Level >= 30)
return m_AccData.m_Level * 15;
else if (m_AccData.m_Level >= 20)
return m_AccData.m_Level * 12;
else if (m_AccData.m_Level >= 10)
return m_AccData.m_Level * 11;
else
return m_AccData.m_Level * 10;
}
Expand Down

0 comments on commit 7e71f3a

Please sign in to comment.