mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-28 15:45:41 +03:00
Fixed bug in BuyMenu.
Added some features gameplay: - extended limits money and round time - FFA mode with mp_friendlyfire 2 - added new cvars mp_maxmoney and mp_minmoney for low limit - added new cvar mp_round_infinite (Infinite round)
This commit is contained in:
parent
c3618f32b1
commit
cc19972496
@ -199,7 +199,7 @@ void setupToolchain(NativeBinarySpec b)
|
|||||||
|
|
||||||
if (regamedllFixes)
|
if (regamedllFixes)
|
||||||
{
|
{
|
||||||
cfg.singleDefines 'REGAMEDLL_FIXES', 'REGAMEDLL_CHECKS'
|
cfg.singleDefines 'REGAMEDLL_FIXES', 'REGAMEDLL_CHECKS', 'REGAMEDLL_ADD'
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolchainConfigUtils.apply(project, cfg, b)
|
ToolchainConfigUtils.apply(project, cfg, b)
|
||||||
|
@ -489,10 +489,21 @@ void CheckStartMoney(void)
|
|||||||
{
|
{
|
||||||
int money = (int)startmoney.value;
|
int money = (int)startmoney.value;
|
||||||
|
|
||||||
|
#ifndef REGAMEDLL_ADD
|
||||||
if (money > 16000)
|
if (money > 16000)
|
||||||
CVAR_SET_FLOAT("mp_startmoney", 16000);
|
CVAR_SET_FLOAT("mp_startmoney", 16000);
|
||||||
else if (money < 800)
|
else if (money < 800)
|
||||||
CVAR_SET_FLOAT("mp_startmoney", 800);
|
CVAR_SET_FLOAT("mp_startmoney", 800);
|
||||||
|
#else
|
||||||
|
int max_money = (int)maxmoney.value;
|
||||||
|
int min_money = (int)minmoney.value;
|
||||||
|
|
||||||
|
if (money > max_money)
|
||||||
|
CVAR_SET_FLOAT("mp_startmoney", max_money);
|
||||||
|
else if (money < min_money)
|
||||||
|
CVAR_SET_FLOAT("mp_startmoney", min_money);
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* <4c084> ../cstrike/dlls/client.cpp:661 */
|
/* <4c084> ../cstrike/dlls/client.cpp:661 */
|
||||||
@ -3322,6 +3333,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
|
|||||||
|
|
||||||
player->BuildRebuyStruct();
|
player->BuildRebuyStruct();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case VGUI_MenuSlot_Buy_Item:
|
case VGUI_MenuSlot_Buy_Item:
|
||||||
{
|
{
|
||||||
|
@ -403,6 +403,14 @@ cvar_t sk_scientist_heal3;
|
|||||||
|
|
||||||
#endif // HOOK_GAMEDLL
|
#endif // HOOK_GAMEDLL
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
|
||||||
|
cvar_t maxmoney = { "mp_maxmoney", "16000", FCVAR_SERVER, 0.0f, NULL };
|
||||||
|
cvar_t minmoney = { "mp_minmoney", "800", FCVAR_SERVER, 0.0f, NULL };
|
||||||
|
cvar_t round_infinite = { "mp_round_infinite", "0", FCVAR_SERVER, 0.0f, NULL };
|
||||||
|
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
/* <9c900> ../cstrike/dlls/game.cpp:500 */
|
/* <9c900> ../cstrike/dlls/game.cpp:500 */
|
||||||
void EXT_FUNC GameDLLInit(void)
|
void EXT_FUNC GameDLLInit(void)
|
||||||
{
|
{
|
||||||
@ -493,6 +501,14 @@ void EXT_FUNC GameDLLInit(void)
|
|||||||
CVAR_REGISTER(&sk_scientist_heal2);
|
CVAR_REGISTER(&sk_scientist_heal2);
|
||||||
CVAR_REGISTER(&sk_scientist_heal3);
|
CVAR_REGISTER(&sk_scientist_heal3);
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
|
||||||
|
CVAR_REGISTER(&maxmoney);
|
||||||
|
CVAR_REGISTER(&minmoney);
|
||||||
|
CVAR_REGISTER(&round_infinite);
|
||||||
|
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
Bot_RegisterCvars();
|
Bot_RegisterCvars();
|
||||||
Tutor_RegisterCVars();
|
Tutor_RegisterCVars();
|
||||||
Hostage_RegisterCVars();
|
Hostage_RegisterCVars();
|
||||||
|
@ -221,6 +221,14 @@ extern cvar_t sk_scientist_heal1;
|
|||||||
extern cvar_t sk_scientist_heal2;
|
extern cvar_t sk_scientist_heal2;
|
||||||
extern cvar_t sk_scientist_heal3;
|
extern cvar_t sk_scientist_heal3;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
|
||||||
|
extern cvar_t maxmoney;
|
||||||
|
extern cvar_t minmoney;
|
||||||
|
extern cvar_t round_infinite;
|
||||||
|
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
void GameDLLInit(void);
|
void GameDLLInit(void);
|
||||||
|
|
||||||
#endif // GAME_H
|
#endif // GAME_H
|
||||||
|
@ -374,6 +374,7 @@ void ReadMultiplayCvars(CHalfLifeMultiplay *mp)
|
|||||||
mp->m_iIntroRoundTime = (int)CVAR_GET_FLOAT("mp_freezetime");
|
mp->m_iIntroRoundTime = (int)CVAR_GET_FLOAT("mp_freezetime");
|
||||||
mp->m_iLimitTeams = (int)CVAR_GET_FLOAT("mp_limitteams");
|
mp->m_iLimitTeams = (int)CVAR_GET_FLOAT("mp_limitteams");
|
||||||
|
|
||||||
|
#ifndef REGAMEDLL_ADD
|
||||||
if (mp->m_iRoundTime > 540)
|
if (mp->m_iRoundTime > 540)
|
||||||
{
|
{
|
||||||
CVAR_SET_FLOAT("mp_roundtime", 9);
|
CVAR_SET_FLOAT("mp_roundtime", 9);
|
||||||
@ -384,6 +385,20 @@ void ReadMultiplayCvars(CHalfLifeMultiplay *mp)
|
|||||||
CVAR_SET_FLOAT("mp_roundtime", 1);
|
CVAR_SET_FLOAT("mp_roundtime", 1);
|
||||||
mp->m_iRoundTime = 60;
|
mp->m_iRoundTime = 60;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// a limit of 500 minutes because
|
||||||
|
// if you do more minutes would be a bug in the HUD RoundTime in the form 00:00
|
||||||
|
if (mp->m_iRoundTime > 30000)
|
||||||
|
{
|
||||||
|
CVAR_SET_FLOAT("mp_roundtime", 500);
|
||||||
|
mp->m_iRoundTime = 30000;
|
||||||
|
}
|
||||||
|
else if (mp->m_iRoundTime < 0)
|
||||||
|
{
|
||||||
|
CVAR_SET_FLOAT("mp_roundtime", 0);
|
||||||
|
mp->m_iRoundTime = 0;
|
||||||
|
}
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
if (mp->m_iIntroRoundTime > 60)
|
if (mp->m_iIntroRoundTime > 60)
|
||||||
{
|
{
|
||||||
@ -1021,6 +1036,11 @@ void CHalfLifeMultiplay::QueueCareerRoundEndMenu(float tmDelay, int iWinStatus)
|
|||||||
/* <117750> ../cstrike/dlls/multiplay_gamerules.cpp:1084 */
|
/* <117750> ../cstrike/dlls/multiplay_gamerules.cpp:1084 */
|
||||||
void CHalfLifeMultiplay::__MAKE_VHOOK(CheckWinConditions)(void)
|
void CHalfLifeMultiplay::__MAKE_VHOOK(CheckWinConditions)(void)
|
||||||
{
|
{
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
if (round_infinite.string[0] == '1')
|
||||||
|
return;
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
// If a winner has already been determined and game of started.. then get the heck out of here
|
// If a winner has already been determined and game of started.. then get the heck out of here
|
||||||
if (m_bFirstConnected && m_iRoundWinStatus != 0)
|
if (m_bFirstConnected && m_iRoundWinStatus != 0)
|
||||||
{
|
{
|
||||||
@ -2817,6 +2837,11 @@ void CHalfLifeMultiplay::CheckFreezePeriodExpired(void)
|
|||||||
|
|
||||||
void CHalfLifeMultiplay::CheckRoundTimeExpired(void)
|
void CHalfLifeMultiplay::CheckRoundTimeExpired(void)
|
||||||
{
|
{
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
if (round_infinite.string[0] == '1')
|
||||||
|
return;
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
if (!HasRoundTimeExpired())
|
if (!HasRoundTimeExpired())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -3672,8 +3697,14 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerKilled)(CBasePlayer *pVictim, entvar
|
|||||||
{
|
{
|
||||||
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
|
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
|
||||||
CBasePlayer *killer = GetClassPtr((CBasePlayer *)pKiller);
|
CBasePlayer *killer = GetClassPtr((CBasePlayer *)pKiller);
|
||||||
|
bool killedByFFA = false;
|
||||||
|
|
||||||
if (killer->m_iTeam == pVictim->m_iTeam)
|
#ifdef REGAMEDLL_ADD
|
||||||
|
if (friendlyfire.string[0] == '2')
|
||||||
|
killedByFFA = true;
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
|
if (killer->m_iTeam == pVictim->m_iTeam && !killedByFFA)
|
||||||
{
|
{
|
||||||
// if a player dies by from teammate
|
// if a player dies by from teammate
|
||||||
pKiller->frags -= IPointsForKill(peKiller, pVictim);
|
pKiller->frags -= IPointsForKill(peKiller, pVictim);
|
||||||
|
@ -1130,7 +1130,10 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
|||||||
{
|
{
|
||||||
if (pGrenade->m_iTeam == m_iTeam)
|
if (pGrenade->m_iTeam == m_iTeam)
|
||||||
teamAttack = TRUE;
|
teamAttack = TRUE;
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
if (friendlyfire.string[0] == '2')
|
||||||
|
teamAttack = FALSE;
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
pAttack = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pevAttacker));
|
pAttack = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pevAttacker));
|
||||||
}
|
}
|
||||||
else if (pGrenade->m_iTeam == m_iTeam && (&edict()->v != pevAttacker))
|
else if (pGrenade->m_iTeam == m_iTeam && (&edict()->v != pevAttacker))
|
||||||
@ -1288,7 +1291,13 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
|||||||
{
|
{
|
||||||
pAttack = GetClassPtr((CBasePlayer *)pevAttacker);
|
pAttack = GetClassPtr((CBasePlayer *)pevAttacker);
|
||||||
|
|
||||||
if (pAttack != this && pAttack->m_iTeam == m_iTeam)
|
bool bAttackFFA = false;
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
if (friendlyfire.string[0] == '2')
|
||||||
|
bAttackFFA = true;
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
|
if (pAttack != this && pAttack->m_iTeam == m_iTeam && !bAttackFFA)
|
||||||
{
|
{
|
||||||
// TODO: this->m_flDisplayHistory!!
|
// TODO: this->m_flDisplayHistory!!
|
||||||
if (!(m_flDisplayHistory & DHF_FRIEND_INJURED))
|
if (!(m_flDisplayHistory & DHF_FRIEND_INJURED))
|
||||||
@ -1318,7 +1327,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pAttack->m_iTeam == m_iTeam)
|
if (pAttack->m_iTeam == m_iTeam && bAttackFFA)
|
||||||
flDamage *= 0.35;
|
flDamage *= 0.35;
|
||||||
|
|
||||||
iGunType = pAttack->m_pActiveItem->m_iId;
|
iGunType = pAttack->m_pActiveItem->m_iId;
|
||||||
@ -2256,7 +2265,6 @@ void CBasePlayer::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_bIsDefusing = false;
|
m_bIsDefusing = false;
|
||||||
|
|
||||||
BuyZoneIcon_Clear(this);
|
BuyZoneIcon_Clear(this);
|
||||||
|
|
||||||
SetThink(&CBasePlayer::PlayerDeathThink);
|
SetThink(&CBasePlayer::PlayerDeathThink);
|
||||||
@ -3196,12 +3204,24 @@ void CBasePlayer::AddAccount(int amount, bool bTrackChange)
|
|||||||
{
|
{
|
||||||
m_iAccount += amount;
|
m_iAccount += amount;
|
||||||
|
|
||||||
|
#ifndef REGAMEDLL_ADD
|
||||||
if (m_iAccount < 0)
|
if (m_iAccount < 0)
|
||||||
m_iAccount = 0;
|
m_iAccount = 0;
|
||||||
|
|
||||||
else if (m_iAccount > 16000)
|
else if (m_iAccount > 16000)
|
||||||
m_iAccount = 16000;
|
m_iAccount = 16000;
|
||||||
|
|
||||||
|
#else
|
||||||
|
int mmoney = (int)maxmoney.value;
|
||||||
|
|
||||||
|
if (m_iAccount < 0)
|
||||||
|
m_iAccount = 0;
|
||||||
|
|
||||||
|
else if (m_iAccount > mmoney)
|
||||||
|
m_iAccount = mmoney;
|
||||||
|
|
||||||
|
#endif // REGAMEDLL_ADD
|
||||||
|
|
||||||
// Send money update to HUD
|
// Send money update to HUD
|
||||||
MESSAGE_BEGIN(MSG_ONE, gmsgMoney, NULL, pev);
|
MESSAGE_BEGIN(MSG_ONE, gmsgMoney, NULL, pev);
|
||||||
WRITE_LONG(m_iAccount);
|
WRITE_LONG(m_iAccount);
|
||||||
|
Loading…
Reference in New Issue
Block a user