Skip to content

Commit

Permalink
Closes #357
Browse files Browse the repository at this point in the history
Reducing allowable money limit cuz a HUD can't draw more than 999k
  • Loading branch information
s1lentq committed Apr 23, 2019
1 parent 8c85aee commit 94f0fdb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1,684 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -24,7 +24,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_freeforall | 0 | 0 | 1 | The style of gameplay where there aren't any teams (FFA mode)<br/>`0` disabled <br/>`1` enabled |
| mp_autoteambalance | 1 | 0 | 2 | Auto balancing of teams.<br/>`0` disabled <br/>`1` on after next round<br/>`2` on next round |
| mp_buytime | 1.5 | 0.0 | - | Designate the desired amount of buy time for each round. (in minutes)<br />`-1` means no time limit<br />`0` disable buy |
| mp_maxmoney | 16000 | 0 | `0x7FFFFFFF` | The maximum allowable amount of money in the game |
| mp_maxmoney | 16000 | 0 | `999999` | The maximum allowable amount of money in the game |
| mp_round_infinite | 0 | 0 | 1 | Flags for fine grained control (choose as many as needed)<br/>`0` disabled<br/>`1` enabled<br/><br/>or flags<br/>`a` block round time round end check<br/>`b` block needed players round end check<br/>`c` block VIP assassination/success round end check<br/>`d` block prison escape round end check<br/>`e` block bomb round end check<br/>`f` block team extermination round end check<br/>`g` block hostage rescue round end check<br/><br/>`Example setting:` "ae" blocks round time and bomb round end checks |
| mp_roundover | 0 | - | - | The round by expired time will be over, if on a map it does not have the scenario of the game.<br/>`0` disabled<br/>`1` enabled |
| mp_round_restart_delay | 5 | - | - | Number of seconds to delay before restarting a round after a win. |
Expand Down
4 changes: 1 addition & 3 deletions dist/game.cfg
@@ -1,6 +1,3 @@
// ReGameDLL Configuration File
echo Executing ReGameDLL Configuration File

// The style of gameplay where there aren't any teams (FFA mode)
// 0 - disabled (default behaviour)
// 1 - enabled
Expand All @@ -24,6 +21,7 @@ mp_autoteambalance 1
mp_buytime 0.25
// The maximum allowable amount of money in the game
// NOTE: Allowable money limit is 999999
//
// Default value: "16000"
mp_maxmoney 16000
Expand Down
5 changes: 5 additions & 0 deletions regamedll/dlls/client.cpp
Expand Up @@ -588,6 +588,11 @@ void CheckStartMoney()
CVAR_SET_FLOAT("mp_startmoney", 800);
#else
int max_money = int(maxmoney.value);
if (max_money > MAX_MONEY_THRESHOLD)
{
max_money = MAX_MONEY_THRESHOLD;
CVAR_SET_FLOAT("mp_maxmoney", MAX_MONEY_THRESHOLD);
}

if (money > max_money)
CVAR_SET_FLOAT("mp_startmoney", max_money);
Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/gamerules.h
Expand Up @@ -34,6 +34,7 @@
const int MAX_RULE_BUFFER = 1024;
const int MAX_VOTE_MAPS = 100;
const int MAX_VIP_QUEUES = 5;
const int MAX_MONEY_THRESHOLD = 999999; // allowable money limit in the game that can be drawn on the HUD

const int MAX_MOTD_CHUNK = 60;
const int MAX_MOTD_LENGTH = 1536; // (MAX_MOTD_CHUNK * 4)
Expand Down
11 changes: 3 additions & 8 deletions regamedll/dlls/player.cpp
Expand Up @@ -3113,12 +3113,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(AddAccount)(int amount, RewardType type, b

if (bSendMoney)
{
auto nMax = int(maxmoney.value);
if (m_iAccount > nMax)
m_iAccount = nMax;

else if (m_iAccount < 0)
m_iAccount = 0;
m_iAccount = clamp<int>(m_iAccount, 0, maxmoney.value);

// Send money update to HUD
MESSAGE_BEGIN(MSG_ONE, gmsgMoney, nullptr, pev);
Expand Down Expand Up @@ -3482,12 +3477,12 @@ void CBasePlayer::PlayerDeathThink()
// we aren't calling into any of their code anymore through the player pointer.
PackDeadPlayerItems();
}

#ifdef REGAMEDLL_FIXES
// Clear inclination came from client view
pev->angles.x = 0;
#endif

if (pev->modelindex && !m_fSequenceFinished && pev->deadflag == DEAD_DYING)
{
StudioFrameAdvance();
Expand Down

0 comments on commit 94f0fdb

Please sign in to comment.