mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
Added cvar mp_refill_bpammo_weapons
Added new things for API Update README.md
This commit is contained in:
parent
51313e9b2b
commit
e6df6ef577
18
README.md
18
README.md
@ -4,15 +4,13 @@ Reverse-engineered gamedll (mp.dll / Counter-Strike)
|
||||
## What is this?
|
||||
Regamedll_CS is a result of reverse engineering of original library mods HLDS (build 6153beta) using DWARF debug info embedded into linux version of HLDS, cs.so
|
||||
|
||||
At the moment, the work of reverse engineering continues
|
||||
|
||||
## Goals of the project
|
||||
* Provide more stable (than official) version of Counter-Strike game with extended API for mods and plugins
|
||||
|
||||
## How can use it?
|
||||
Regamedll_CS is fully compatible with official mod CS 1.6 by Valve. All you have to do is to download binaries and replace original mo.dll/cs.so
|
||||
|
||||
Compiled binaries are available here: http://nexus.rehlds.org/nexus/content/repositories/regamedll-snapshots/regamedll/regamedll/0.2-SNAPSHOT/
|
||||
Compiled binaries are available here: [link](http://nexus.rehlds.org/nexus/content/repositories/regamedll-snapshots/regamedll/regamedll/0.2-SNAPSHOT/)
|
||||
|
||||
Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
|
||||
* 'pure' version is designed to work exactly as official mod CS
|
||||
@ -20,9 +18,17 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
|
||||
|
||||
<b>Warning!</b> Regamedll_CS is not binary compatible with original hlds since it's compiled with compilers other than ones used for original mod CS. This means that plugins that do binary code analysis (Orpheu for example) probably will not work with Regamedll_CS.
|
||||
|
||||
## Current status
|
||||
* Counter-Strike 1.6 - 100%
|
||||
* Counter-Strike: Condition Zero - 100%
|
||||
## Configuration (cvars)
|
||||
| CVar | Default | Min | Max | Description |
|
||||
| :---------------------------- | :-----: | :-: | :----------: | :--------------------------------------------- |
|
||||
| mp_friendlyfire | 0 | 0 | 2 | Allow inflict damage to teammates<br/>`0` disabled <br/>`1` enabled <br/>`2` FFA mode |
|
||||
| mp_maxmoney | 16000 | 0 | `0x7FFFFFFF` | 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_hegrenade_penetration | 0 | 0 | 1 | Disable grenade damage through walls<br>`0` disabled<br>`1` enabled |
|
||||
| mp_nadedrops | 0 | 0 | 2 | Drop a grenade after player death<br>`0` disabled<br>`1` drop one the grenade<br>`2` drop a everyone grenades |
|
||||
| mp_roundrespawn_time | 20 | 0 | - | Player cannot respawn until next round if more than N seconds has elapsed since the beginning round |
|
||||
| mp_auto_reload_weapons | 0 | 0 | 1 | Automatically reload each weapon on player spawn<br>`0` disabled<br>`1` enabled |
|
||||
| mp_refill_bpammo_weapons | 0 | 0 | 2 | Refill amount of backpack ammo up to the max <br/>`0` disabled<br/>`1` refill backpack ammo on player spawn<br/>`2` refill backpack ammo on each weapon reload |
|
||||
|
||||
## How to install zBot for CS 1.6?
|
||||
* Extract all the files from an [archive](regamedll/extra/zBot/bot_profiles.zip?raw=true)
|
||||
|
14
dist/game.cfg
vendored
14
dist/game.cfg
vendored
@ -39,8 +39,8 @@ mp_hegrenade_penetration 0
|
||||
|
||||
// Drop a grenade after player death
|
||||
// 0 - disabled
|
||||
// 1 - enabled (only the first slot grenades)
|
||||
// 2 - drop a everyone
|
||||
// 1 - drop one the grenade
|
||||
// 2 - drop a everyone grenades
|
||||
// Default value: "0"
|
||||
mp_nadedrops 0
|
||||
|
||||
@ -50,9 +50,17 @@ mp_nadedrops 0
|
||||
// Default value: "20"
|
||||
mp_roundrespawn_time 20
|
||||
|
||||
// Automatically reloaded all weapons a spawn the player
|
||||
// Automatically reload each weapon on player spawn
|
||||
// 0 - disabled (default behaviour)
|
||||
// 1 - enabled
|
||||
//
|
||||
// Default value: "0"
|
||||
mp_auto_reload_weapons "0"
|
||||
|
||||
// Refill amount of backpack ammo up to the max
|
||||
// 0 - disabled (default behaviour)
|
||||
// 1 - refill backpack ammo on player spawn
|
||||
// 2 - refill backpack ammo on each weapon reload (NOTE: Useful for mods like DeathMatch, GunGame, ZombieMod etc.)
|
||||
//
|
||||
// Default value: "0"
|
||||
mp_refill_bpammo_weapons 0
|
||||
|
@ -261,7 +261,7 @@ void BuyState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
|
||||
if (!(me->m_signals.GetState() & SIGNAL_BUY))
|
||||
{
|
||||
m_doneBuying = true;
|
||||
UTIL_DPrintf("%s bot spawned outside of a buy zone (%d, %d, %d)\n", (me->m_iTeam == CT) ? "CT" : "Terrorist", me->pev->origin.x, me->pev->origin.y, me->pev->origin.z);
|
||||
UTIL_DPrintf("%s bot spawned outside of a buy zone (%d, %d, %d)\n", (me->m_iTeam == CT) ? "CT" : "Terrorist", int(me->pev->origin.x), int(me->pev->origin.y), int(me->pev->origin.z));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -102,6 +102,7 @@ cvar_t hegrenade_penetration = { "mp_hegrenade_penetration", "0", 0, 0.0f, nullp
|
||||
cvar_t nadedrops = { "mp_nadedrops", "0", 0, 0.0f, nullptr };
|
||||
cvar_t roundrespawn_time = { "mp_roundrespawn_time", "20", 0, 20.0f, nullptr };
|
||||
cvar_t auto_reload_weapons = { "mp_auto_reload_weapons", "0", 0, 0.0f, nullptr };
|
||||
cvar_t refill_bpammo_weapons = { "mp_refill_bpammo_weapons", "0", 0, 0.0f, nullptr }; // Useful for mods like CSDM, GunGame, ZombieMod etc
|
||||
|
||||
void GameDLL_Version_f()
|
||||
{
|
||||
@ -116,7 +117,7 @@ void GameDLL_Version_f()
|
||||
|
||||
void GameDLL_EndRound_f()
|
||||
{
|
||||
EndRoundMessage("#Round_Draw", ROUND_END_DRAW);
|
||||
CSGameRules()->EndRoundMessage("#Round_Draw", ROUND_END_DRAW);
|
||||
Broadcast("rounddraw");
|
||||
CSGameRules()->TerminateRound(5, WINSTATUS_DRAW);
|
||||
}
|
||||
@ -230,6 +231,7 @@ void EXT_FUNC GameDLLInit()
|
||||
CVAR_REGISTER(&nadedrops);
|
||||
CVAR_REGISTER(&roundrespawn_time);
|
||||
CVAR_REGISTER(&auto_reload_weapons);
|
||||
CVAR_REGISTER(&refill_bpammo_weapons);
|
||||
|
||||
// print version
|
||||
CONSOLE_ECHO("ReGameDLL build: " __TIME__ " " __DATE__ " (" APP_VERSION_STRD ")\n");
|
||||
|
@ -139,6 +139,7 @@ extern cvar_t hegrenade_penetration;
|
||||
extern cvar_t nadedrops;
|
||||
extern cvar_t roundrespawn_time;
|
||||
extern cvar_t auto_reload_weapons;
|
||||
extern cvar_t refill_bpammo_weapons;
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -96,6 +96,33 @@ enum ScenarioEventEndRound
|
||||
ROUND_GAME_COMMENCE,
|
||||
};
|
||||
|
||||
enum RewardRules
|
||||
{
|
||||
RR_CTS_WIN,
|
||||
RR_TERRORISTS_WIN,
|
||||
RR_TARGET_BOMB,
|
||||
RR_VIP_ESCAPED,
|
||||
RR_VIP_ASSASSINATED,
|
||||
RR_TERRORISTS_ESCAPED,
|
||||
RR_CTS_PREVENT_ESCAPE,
|
||||
RR_ESCAPING_TERRORISTS_NEUTRALIZED,
|
||||
RR_BOMB_DEFUSED,
|
||||
RR_BOMB_PLANTED,
|
||||
RR_BOMB_EXPLODED,
|
||||
RR_ALL_HOSTAGES_RESCUED,
|
||||
RR_TARGET_BOMB_SAVED,
|
||||
RR_HOSTAGE_NOT_RESCUED,
|
||||
RR_VIP_NOT_ESCAPED,
|
||||
RR_LOSER_BONUS_DEFAULT,
|
||||
RR_LOSER_BONUS_MIN,
|
||||
RR_LOSER_BONUS_MAX,
|
||||
RR_LOSER_BONUS_ADD,
|
||||
RR_RESCUED_HOSTAGE,
|
||||
RR_TOOK_HOSTAGE_ACC,
|
||||
RR_TOOK_HOSTAGE,
|
||||
RR_END
|
||||
};
|
||||
|
||||
// custom enum
|
||||
enum RewardAccount
|
||||
{
|
||||
@ -129,8 +156,8 @@ enum RewardAccount
|
||||
REWARD_VIP_HAVE_SELF_RESCUED = 2500,
|
||||
|
||||
REWARD_TAKEN_HOSTAGE = 1000,
|
||||
REWARD_TOOK_HOSTAGE = 150
|
||||
|
||||
REWARD_TOOK_HOSTAGE_ACC = 100,
|
||||
REWARD_TOOK_HOSTAGE = 150,
|
||||
};
|
||||
|
||||
// custom enum
|
||||
@ -363,6 +390,12 @@ public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
};
|
||||
|
||||
#if defined(REGAMEDLL_ADD) && !defined(HOOK_GAMEDLL)
|
||||
#define VFUNC virtual
|
||||
#else
|
||||
#define VFUNC
|
||||
#endif
|
||||
|
||||
class CHalfLifeMultiplay: public CGameRules
|
||||
{
|
||||
public:
|
||||
@ -507,7 +540,7 @@ public:
|
||||
bool NeededPlayersCheck();
|
||||
|
||||
// Setup counts for m_iNumTerrorist, m_iNumCT, m_iNumSpawnableTerrorist, m_iNumSpawnableCT, etc.
|
||||
void InitializePlayerCounts(int &NumAliveTerrorist, int &NumAliveCT, int &NumDeadTerrorist, int &NumDeadCT);
|
||||
VFUNC void InitializePlayerCounts(int &NumAliveTerrorist, int &NumAliveCT, int &NumDeadTerrorist, int &NumDeadCT);
|
||||
|
||||
// Check to see if the round is over for the various game types. Terminates the round
|
||||
// and returns true if the round should end.
|
||||
@ -574,18 +607,21 @@ public:
|
||||
void StackVIPQueue();
|
||||
void ResetCurrentVIP();
|
||||
|
||||
void BalanceTeams();
|
||||
VFUNC void BalanceTeams();
|
||||
void BalanceTeams_();
|
||||
|
||||
void SwapAllPlayers();
|
||||
void UpdateTeamScores();
|
||||
VFUNC void SwapAllPlayers();
|
||||
VFUNC void UpdateTeamScores();
|
||||
VFUNC void EndRoundMessage(const char *sentence, int event);
|
||||
VFUNC void SetAccountRules(RewardRules rules, int amount) { m_rgRewardAccountRules[rules] = static_cast<RewardAccount>(amount); }
|
||||
|
||||
void DisplayMaps(CBasePlayer *player, int iVote);
|
||||
void ResetAllMapVotes();
|
||||
void ProcessMapVote(CBasePlayer *player, int iVote);
|
||||
|
||||
// BOMB MAP FUNCTIONS
|
||||
BOOL IsThereABomber();
|
||||
BOOL IsThereABomb();
|
||||
VFUNC BOOL IsThereABomber();
|
||||
VFUNC BOOL IsThereABomb();
|
||||
|
||||
bool IsMatchStarted() { return (m_fTeamCount != 0.0f || m_fCareerRoundMenuTime != 0.0f || m_fCareerMatchMenuTime != 0.0f); }
|
||||
void SendMOTDToClient(edict_t *client);
|
||||
@ -598,11 +634,13 @@ public:
|
||||
bool HasRoundInfinite(bool time_expired = false) const;
|
||||
|
||||
private:
|
||||
bool HasRoundTimeExpired();
|
||||
bool IsBombPlanted();
|
||||
VFUNC bool HasRoundTimeExpired();
|
||||
VFUNC bool IsBombPlanted();
|
||||
void MarkLivingPlayersOnTeamAsNotReceivingMoneyNextRound(int iTeam);
|
||||
|
||||
public:
|
||||
static RewardAccount m_rgRewardAccountRules[];
|
||||
|
||||
CVoiceGameMgr m_VoiceGameMgr;
|
||||
float m_fTeamCount; // m_flRestartRoundTime, the global time when the round is supposed to end, if this is not 0
|
||||
float m_flCheckWinConditions;
|
||||
|
@ -910,7 +910,7 @@ void CHostage::GiveCTTouchBonus(CBasePlayer *pPlayer)
|
||||
return;
|
||||
|
||||
m_bTouched = TRUE;
|
||||
CSGameRules()->m_iAccountCT += 100;
|
||||
CSGameRules()->m_iAccountCT += CSGameRules()->m_rgRewardAccountRules[RR_TOOK_HOSTAGE_ACC];
|
||||
|
||||
pPlayer->AddAccount(REWARD_TOOK_HOSTAGE, RT_HOSTAGE_TOOK);
|
||||
UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Touched_A_Hostage\"\n", STRING(pPlayer->pev->netname), GETPLAYERUSERID(pPlayer->edict()), GETPLAYERAUTHID(pPlayer->edict()));
|
||||
|
@ -11,7 +11,31 @@ cvar_t *sv_clienttrace = NULL;
|
||||
#endif
|
||||
|
||||
CCStrikeGameMgrHelper g_GameMgrHelper;
|
||||
CHalfLifeMultiplay *g_pMPGameRules = NULL;
|
||||
CHalfLifeMultiplay *g_pMPGameRules = nullptr;
|
||||
RewardAccount CHalfLifeMultiplay::m_rgRewardAccountRules[] = {
|
||||
REWARD_CTS_WIN, // RR_CTS_WIN
|
||||
REWARD_TERRORISTS_WIN, // RR_TERRORISTS_WIN
|
||||
REWARD_TARGET_BOMB, // RR_TARGET_BOMB
|
||||
REWARD_VIP_ESCAPED, // RR_VIP_ESCAPED
|
||||
REWARD_VIP_ASSASSINATED, // RR_VIP_ASSASSINATED
|
||||
REWARD_TERRORISTS_ESCAPED, // RR_TERRORISTS_ESCAPED
|
||||
REWARD_CTS_PREVENT_ESCAPE, // RR_CTS_PREVENT_ESCAPE
|
||||
REWARD_ESCAPING_TERRORISTS_NEUTRALIZED, // RR_ESCAPING_TERRORISTS_NEUTRALIZED
|
||||
REWARD_BOMB_DEFUSED, // RR_BOMB_DEFUSED
|
||||
REWARD_BOMB_PLANTED, // RR_BOMB_PLANTED
|
||||
REWARD_BOMB_EXPLODED, // RR_BOMB_EXPLODED
|
||||
REWARD_ALL_HOSTAGES_RESCUED, // RR_ALL_HOSTAGES_RESCUED
|
||||
REWARD_TARGET_BOMB_SAVED, // RR_TARGET_BOMB_SAVED
|
||||
REWARD_HOSTAGE_NOT_RESCUED, // RR_HOSTAGE_NOT_RESCUED
|
||||
REWARD_VIP_NOT_ESCAPED, // RR_VIP_NOT_ESCAPED
|
||||
REWARD_LOSER_BONUS_DEFAULT, // RR_LOSER_BONUS_DEFAULT
|
||||
REWARD_LOSER_BONUS_MIN, // RR_LOSER_BONUS_MIN
|
||||
REWARD_LOSER_BONUS_MAX, // RR_LOSER_BONUS_MAX
|
||||
REWARD_LOSER_BONUS_ADD, // RR_LOSER_BONUS_ADD
|
||||
REWARD_RESCUED_HOSTAGE, // RR_RESCUED_HOSTAGE
|
||||
REWARD_TOOK_HOSTAGE_ACC, // RR_TOOK_HOSTAGE_ACC
|
||||
REWARD_TOOK_HOSTAGE, // RR_TOOK_HOSTAGE
|
||||
};
|
||||
|
||||
bool IsBotSpeaking()
|
||||
{
|
||||
@ -260,7 +284,7 @@ char *GetTeam(int teamNo)
|
||||
return "";
|
||||
}
|
||||
|
||||
void EXT_FUNC EndRoundMessage(const char *sentence, int event)
|
||||
void CHalfLifeMultiplay::EndRoundMessage(const char *sentence, int event)
|
||||
{
|
||||
char *team = NULL;
|
||||
const char *message = &(sentence[1]);
|
||||
@ -308,16 +332,13 @@ void EXT_FUNC EndRoundMessage(const char *sentence, int event)
|
||||
break;
|
||||
}
|
||||
|
||||
if (CSGameRules() != NULL)
|
||||
{
|
||||
if (bTeamTriggered)
|
||||
{
|
||||
UTIL_LogPrintf("Team \"%s\" triggered \"%s\" (CT \"%i\") (T \"%i\")\n", team, message, CSGameRules()->m_iNumCTWins, CSGameRules()->m_iNumTerroristWins);
|
||||
UTIL_LogPrintf("Team \"%s\" triggered \"%s\" (CT \"%i\") (T \"%i\")\n", team, message, m_iNumCTWins, m_iNumTerroristWins);
|
||||
}
|
||||
else
|
||||
{
|
||||
UTIL_LogPrintf("World triggered \"%s\" (CT \"%i\") (T \"%i\")\n", message, CSGameRules()->m_iNumCTWins, CSGameRules()->m_iNumTerroristWins);
|
||||
}
|
||||
UTIL_LogPrintf("World triggered \"%s\" (CT \"%i\") (T \"%i\")\n", message, m_iNumCTWins, m_iNumTerroristWins);
|
||||
}
|
||||
|
||||
UTIL_LogPrintf("World triggered \"Round_End\"\n");
|
||||
@ -429,7 +450,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay()
|
||||
m_bMapHasCameras = MAP_HAS_CAMERAS_INIT;
|
||||
g_fGameOver = FALSE;
|
||||
|
||||
m_iLoserBonus = REWARD_LOSER_BONUS_DEFAULT;
|
||||
m_iLoserBonus = m_rgRewardAccountRules[RR_LOSER_BONUS_DEFAULT];
|
||||
m_iNumConsecutiveCTLoses = 0;
|
||||
m_iNumConsecutiveTerroristLoses = 0;
|
||||
m_iC4Guy = 0;
|
||||
@ -1148,7 +1169,7 @@ bool CHalfLifeMultiplay::NeededPlayersCheck()
|
||||
bool CHalfLifeMultiplay::VIP_Escaped_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("ctwin");
|
||||
m_iAccountCT += REWARD_VIP_ESCAPED;
|
||||
m_iAccountCT += m_rgRewardAccountRules[RR_VIP_ESCAPED];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1185,7 +1206,7 @@ bool CHalfLifeMultiplay::VIP_Escaped_internal(int winStatus, ScenarioEventEndRou
|
||||
bool CHalfLifeMultiplay::VIP_Died_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("terwin");
|
||||
m_iAccountTerrorist += REWARD_VIP_ASSASSINATED;
|
||||
m_iAccountTerrorist += m_rgRewardAccountRules[RR_VIP_ASSASSINATED];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1233,7 +1254,7 @@ bool CHalfLifeMultiplay::VIPRoundEndCheck()
|
||||
bool CHalfLifeMultiplay::Prison_Escaped_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("terwin");
|
||||
m_iAccountTerrorist += REWARD_TERRORISTS_ESCAPED;
|
||||
m_iAccountTerrorist += m_rgRewardAccountRules[RR_TERRORISTS_ESCAPED];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1257,7 +1278,7 @@ bool CHalfLifeMultiplay::Prison_PreventEscape_internal(int winStatus, ScenarioEv
|
||||
|
||||
Broadcast("ctwin");
|
||||
// CTs are rewarded based on how many terrorists have escaped...
|
||||
m_iAccountCT += (1 - m_flEscapeRatio) * REWARD_CTS_PREVENT_ESCAPE;
|
||||
m_iAccountCT += (1 - m_flEscapeRatio) * m_rgRewardAccountRules[RR_CTS_PREVENT_ESCAPE];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1281,7 +1302,7 @@ bool CHalfLifeMultiplay::Prison_Neutralized_internal(int winStatus, ScenarioEven
|
||||
|
||||
Broadcast("ctwin");
|
||||
// CTs are rewarded based on how many terrorists have escaped...
|
||||
m_iAccountCT += (1 - m_flEscapeRatio) * REWARD_ESCAPING_TERRORISTS_NEUTRALIZED;
|
||||
m_iAccountCT += (1 - m_flEscapeRatio) * m_rgRewardAccountRules[RR_ESCAPING_TERRORISTS_NEUTRALIZED];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1329,7 +1350,7 @@ bool CHalfLifeMultiplay::PrisonRoundEndCheck(int NumAliveTerrorist, int NumAlive
|
||||
bool CHalfLifeMultiplay::Target_Bombed_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("terwin");
|
||||
m_iAccountTerrorist += REWARD_TARGET_BOMB;
|
||||
m_iAccountTerrorist += m_rgRewardAccountRules[RR_TARGET_BOMB];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1352,8 +1373,8 @@ bool CHalfLifeMultiplay::Target_Bombed_internal(int winStatus, ScenarioEventEndR
|
||||
bool CHalfLifeMultiplay::Target_Defused_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("ctwin");
|
||||
m_iAccountCT += REWARD_BOMB_DEFUSED;
|
||||
m_iAccountTerrorist += REWARD_BOMB_PLANTED;
|
||||
m_iAccountCT += m_rgRewardAccountRules[RR_BOMB_DEFUSED];
|
||||
m_iAccountTerrorist += m_rgRewardAccountRules[RR_BOMB_PLANTED];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1391,7 +1412,7 @@ bool CHalfLifeMultiplay::BombRoundEndCheck()
|
||||
bool CHalfLifeMultiplay::Round_Cts_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("ctwin");
|
||||
m_iAccountCT += m_bMapHasBombTarget ? REWARD_BOMB_DEFUSED : REWARD_CTS_WIN;
|
||||
m_iAccountCT += m_rgRewardAccountRules[m_bMapHasBombTarget ? RR_BOMB_DEFUSED : RR_CTS_WIN];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1414,7 +1435,7 @@ bool CHalfLifeMultiplay::Round_Cts_internal(int winStatus, ScenarioEventEndRound
|
||||
bool CHalfLifeMultiplay::Round_Ts_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("terwin");
|
||||
m_iAccountTerrorist += m_bMapHasBombTarget ? REWARD_BOMB_EXPLODED : REWARD_TERRORISTS_WIN;
|
||||
m_iAccountTerrorist += m_rgRewardAccountRules[m_bMapHasBombTarget ? RR_BOMB_EXPLODED : RR_TERRORISTS_WIN];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1487,7 +1508,7 @@ bool CHalfLifeMultiplay::TeamExterminationCheck(int NumAliveTerrorist, int NumAl
|
||||
bool CHalfLifeMultiplay::Hostage_Rescue_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("ctwin");
|
||||
m_iAccountCT += REWARD_ALL_HOSTAGES_RESCUED;
|
||||
m_iAccountCT += m_rgRewardAccountRules[RR_ALL_HOSTAGES_RESCUED];
|
||||
|
||||
if (!m_bNeededPlayers)
|
||||
{
|
||||
@ -1925,7 +1946,7 @@ void CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
|
||||
|
||||
if (hostage->pev->solid != SOLID_NOT)
|
||||
{
|
||||
acct_tmp += REWARD_TOOK_HOSTAGE;
|
||||
acct_tmp += m_rgRewardAccountRules[RR_TOOK_HOSTAGE];
|
||||
|
||||
if (hostage->pev->deadflag == DEAD_DEAD)
|
||||
{
|
||||
@ -1943,7 +1964,7 @@ void CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
|
||||
if (m_iNumConsecutiveTerroristLoses > 1)
|
||||
{
|
||||
// this is the default losing bonus
|
||||
m_iLoserBonus = REWARD_LOSER_BONUS_MIN;
|
||||
m_iLoserBonus = m_rgRewardAccountRules[RR_LOSER_BONUS_MIN];
|
||||
}
|
||||
|
||||
m_iNumConsecutiveTerroristLoses = 0; // starting fresh
|
||||
@ -1955,7 +1976,7 @@ void CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
|
||||
if (m_iNumConsecutiveCTLoses > 1)
|
||||
{
|
||||
// this is the default losing bonus
|
||||
m_iLoserBonus = REWARD_LOSER_BONUS_MIN;
|
||||
m_iLoserBonus = m_rgRewardAccountRules[RR_LOSER_BONUS_MIN];
|
||||
}
|
||||
|
||||
m_iNumConsecutiveCTLoses = 0; // starting fresh
|
||||
@ -1963,15 +1984,15 @@ void CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
|
||||
}
|
||||
|
||||
// check if the losing team is in a losing streak & that the loser bonus hasen't maxed out.
|
||||
if (m_iNumConsecutiveTerroristLoses > 1 && m_iLoserBonus < REWARD_LOSER_BONUS_MAX)
|
||||
if (m_iNumConsecutiveTerroristLoses > 1 && m_iLoserBonus < m_rgRewardAccountRules[RR_LOSER_BONUS_MAX])
|
||||
{
|
||||
// help out the team in the losing streak
|
||||
m_iLoserBonus += REWARD_LOSER_BONUS_ADD;
|
||||
m_iLoserBonus += m_rgRewardAccountRules[RR_LOSER_BONUS_ADD];
|
||||
}
|
||||
else if (m_iNumConsecutiveCTLoses > 1 && m_iLoserBonus < REWARD_LOSER_BONUS_MAX)
|
||||
else if (m_iNumConsecutiveCTLoses > 1 && m_iLoserBonus < m_rgRewardAccountRules[RR_LOSER_BONUS_MAX])
|
||||
{
|
||||
// help out the team in the losing streak
|
||||
m_iLoserBonus += REWARD_LOSER_BONUS_ADD;
|
||||
m_iLoserBonus += m_rgRewardAccountRules[RR_LOSER_BONUS_ADD];
|
||||
}
|
||||
|
||||
// assign the wining and losing bonuses
|
||||
@ -1992,7 +2013,7 @@ void CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
|
||||
}
|
||||
|
||||
// Update CT account based on number of hostages rescued
|
||||
m_iAccountCT += m_iHostagesRescued * REWARD_RESCUED_HOSTAGE;
|
||||
m_iAccountCT += m_iHostagesRescued * m_rgRewardAccountRules[RR_RESCUED_HOSTAGE];
|
||||
|
||||
// Update individual players accounts and respawn players
|
||||
|
||||
@ -2010,7 +2031,7 @@ void CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
|
||||
m_iNumCTWins = 0;
|
||||
m_iNumConsecutiveTerroristLoses = 0;
|
||||
m_iNumConsecutiveCTLoses = 0;
|
||||
m_iLoserBonus = REWARD_LOSER_BONUS_DEFAULT;
|
||||
m_iLoserBonus = m_rgRewardAccountRules[RR_LOSER_BONUS_DEFAULT];
|
||||
}
|
||||
|
||||
// tell bots that the round is restarting
|
||||
@ -2819,7 +2840,7 @@ void CHalfLifeMultiplay::CheckFreezePeriodExpired()
|
||||
bool CHalfLifeMultiplay::Target_Saved_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("ctwin");
|
||||
m_iAccountCT += REWARD_TARGET_BOMB_SAVED;
|
||||
m_iAccountCT += m_rgRewardAccountRules[RR_TARGET_BOMB_SAVED];
|
||||
m_iNumCTWins++;
|
||||
|
||||
EndRoundMessage("#Target_Saved", event);
|
||||
@ -2839,7 +2860,7 @@ bool CHalfLifeMultiplay::Target_Saved_internal(int winStatus, ScenarioEventEndRo
|
||||
bool CHalfLifeMultiplay::Hostage_NotRescued_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("terwin");
|
||||
m_iAccountTerrorist += REWARD_HOSTAGE_NOT_RESCUED;
|
||||
m_iAccountTerrorist += m_rgRewardAccountRules[RR_HOSTAGE_NOT_RESCUED];
|
||||
m_iNumTerroristWins++;
|
||||
|
||||
EndRoundMessage("#Hostages_Not_Rescued", event);
|
||||
@ -2875,7 +2896,7 @@ bool CHalfLifeMultiplay::Prison_NotEscaped_internal(int winStatus, ScenarioEvent
|
||||
bool CHalfLifeMultiplay::VIP_NotEscaped_internal(int winStatus, ScenarioEventEndRound event, float tmDelay) {
|
||||
|
||||
Broadcast("terwin");
|
||||
m_iAccountTerrorist += REWARD_VIP_NOT_ESCAPED;
|
||||
m_iAccountTerrorist += m_rgRewardAccountRules[RR_VIP_NOT_ESCAPED];
|
||||
m_iNumTerroristWins++;
|
||||
|
||||
EndRoundMessage("#VIP_Not_Escaped", event);
|
||||
|
@ -3125,23 +3125,17 @@ void CBasePlayer::__API_HOOK(AddAccount)(int amount, RewardType type, bool bTrac
|
||||
m_iAccount += amount;
|
||||
|
||||
#ifndef REGAMEDLL_ADD
|
||||
if (m_iAccount < 0)
|
||||
m_iAccount = 0;
|
||||
|
||||
else if (m_iAccount > 16000)
|
||||
if (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;
|
||||
|
||||
auto nMax = int(maxmoney.value);
|
||||
if (m_iAccount > nMax)
|
||||
m_iAccount = nMax;
|
||||
#endif
|
||||
|
||||
else if (m_iAccount < 0)
|
||||
m_iAccount = 0;
|
||||
|
||||
// Send money update to HUD
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgMoney, NULL, pev);
|
||||
WRITE_LONG(m_iAccount);
|
||||
@ -5258,9 +5252,7 @@ void EXT_ALIGN CBasePlayer::__API_VHOOK(Spawn)()
|
||||
m_flFlashLightTime = 1;
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
if (auto_reload_weapons.string[0] == '1') {
|
||||
ReloadWeapons();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_bHasDefuser)
|
||||
@ -9244,8 +9236,15 @@ void CBasePlayer::UpdateLocation(bool forceUpdate)
|
||||
}
|
||||
}
|
||||
|
||||
void CBasePlayer::ReloadWeapons(CBasePlayerItem *pWeapon)
|
||||
void CBasePlayer::ReloadWeapons(CBasePlayerItem *pWeapon, bool bForceReload, bool bForceRefill)
|
||||
{
|
||||
#ifdef REGAMEDLL_ADD
|
||||
bool bCanAutoReload = (bForceReload || auto_reload_weapons.value != 0.0f);
|
||||
bool bCanRefillBPAmmo = (bForceRefill || refill_bpammo_weapons.value != 0.0f);
|
||||
|
||||
if (!bCanAutoReload && !bCanRefillBPAmmo)
|
||||
return;
|
||||
|
||||
// if we died in the previous round
|
||||
// so that we have nothing to reload
|
||||
if (!m_bNotKilled)
|
||||
@ -9261,7 +9260,14 @@ void CBasePlayer::ReloadWeapons(CBasePlayerItem *pWeapon)
|
||||
while (item != nullptr)
|
||||
{
|
||||
if (pWeapon == nullptr || pWeapon == item)
|
||||
((CBasePlayerWeapon *)item)->InstantReload();
|
||||
{
|
||||
if (bCanRefillBPAmmo) {
|
||||
m_rgAmmo[ item->PrimaryAmmoIndex() ] = item->iMaxAmmo1();
|
||||
}
|
||||
if (bCanAutoReload) {
|
||||
((CBasePlayerWeapon *)item)->InstantReload(bCanRefillBPAmmo);
|
||||
}
|
||||
}
|
||||
|
||||
if (pWeapon == item)
|
||||
break;
|
||||
@ -9272,4 +9278,5 @@ void CBasePlayer::ReloadWeapons(CBasePlayerItem *pWeapon)
|
||||
if (pWeapon != nullptr && pWeapon == item)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -589,7 +589,7 @@ public:
|
||||
void SendItemStatus();
|
||||
edict_t *EntSelectSpawnPoint();
|
||||
void SetScoreAttrib(CBasePlayer *dest);
|
||||
void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr);
|
||||
void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false);
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
CCSPlayer *CSPlayer() const;
|
||||
|
@ -904,7 +904,17 @@ void CBasePlayerWeapon::__MAKE_VHOOK(ItemPostFrame)()
|
||||
|
||||
// Add them to the clip
|
||||
m_iClip += j;
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
// Do not remove bpammo of the player,
|
||||
// if cvar allows to refill bpammo on during reloading the weapons
|
||||
if (refill_bpammo_weapons.value < 2.0f) {
|
||||
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] -= j;
|
||||
}
|
||||
#else
|
||||
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] -= j;
|
||||
#endif
|
||||
|
||||
m_pPlayer->TabulateAmmo();
|
||||
m_fInReload = FALSE;
|
||||
}
|
||||
@ -1305,7 +1315,6 @@ int CBasePlayerWeapon::DefaultReload(int iClipSize, int iAnim, float fDelay)
|
||||
return FALSE;
|
||||
|
||||
int j = Q_min(iClipSize - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]);
|
||||
|
||||
if (!j)
|
||||
{
|
||||
return FALSE;
|
||||
@ -2233,7 +2242,9 @@ void CArmoury::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
|
||||
LINK_ENTITY_TO_CLASS(armoury_entity, CArmoury, CCSArmoury);
|
||||
|
||||
void CBasePlayerWeapon::InstantReload()
|
||||
// true - keep the amount of bpammo
|
||||
// false - let take away bpammo
|
||||
void CBasePlayerWeapon::InstantReload(bool bCanRefillBPAmmo)
|
||||
{
|
||||
// if you already reload
|
||||
if (m_fInReload)
|
||||
@ -2249,6 +2260,10 @@ void CBasePlayerWeapon::InstantReload()
|
||||
|
||||
// Add them to the clip
|
||||
m_iClip += j;
|
||||
|
||||
if (!bCanRefillBPAmmo) {
|
||||
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] -= j;
|
||||
}
|
||||
|
||||
m_pPlayer->TabulateAmmo();
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ public:
|
||||
void SetPlayerShieldAnim();
|
||||
void ResetPlayerShieldAnim();
|
||||
bool ShieldSecondaryFire(int iUpAnim, int iDownAnim);
|
||||
void InstantReload();
|
||||
void InstantReload(bool bCanRefillBPAmmo = false);
|
||||
|
||||
public:
|
||||
static TYPEDESCRIPTION IMPL(m_SaveData)[7];
|
||||
|
@ -45,7 +45,7 @@ int CUSP::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p)
|
||||
p->pszAmmo1 = "45ACP";
|
||||
#endif // REGAMEDLL_FIXES
|
||||
p->iMaxAmmo1 = MAX_AMMO_45ACP;
|
||||
p->pszAmmo2 = 0;
|
||||
p->pszAmmo2 = NULL;
|
||||
p->iMaxAmmo2 = -1;
|
||||
p->iMaxClip = USP_MAX_CLIP;
|
||||
p->iSlot = 1;
|
||||
|
@ -90,6 +90,33 @@ enum ScenarioEventEndRound
|
||||
ROUND_GAME_COMMENCE,
|
||||
};
|
||||
|
||||
enum RewardRules
|
||||
{
|
||||
RR_CTS_WIN,
|
||||
RR_TERRORISTS_WIN,
|
||||
RR_TARGET_BOMB,
|
||||
RR_VIP_ESCAPED,
|
||||
RR_VIP_ASSASSINATED,
|
||||
RR_TERRORISTS_ESCAPED,
|
||||
RR_CTS_PREVENT_ESCAPE,
|
||||
RR_ESCAPING_TERRORISTS_NEUTRALIZED,
|
||||
RR_BOMB_DEFUSED,
|
||||
RR_BOMB_PLANTED,
|
||||
RR_BOMB_EXPLODED,
|
||||
RR_ALL_HOSTAGES_RESCUED,
|
||||
RR_TARGET_BOMB_SAVED,
|
||||
RR_HOSTAGE_NOT_RESCUED,
|
||||
RR_VIP_NOT_ESCAPED,
|
||||
RR_LOSER_BONUS_DEFAULT,
|
||||
RR_LOSER_BONUS_MIN,
|
||||
RR_LOSER_BONUS_MAX,
|
||||
RR_LOSER_BONUS_ADD,
|
||||
RR_RESCUED_HOSTAGE,
|
||||
RR_TOOK_HOSTAGE_ACC,
|
||||
RR_TOOK_HOSTAGE,
|
||||
RR_END
|
||||
};
|
||||
|
||||
// custom enum
|
||||
enum RewardAccount
|
||||
{
|
||||
@ -371,6 +398,23 @@ public:
|
||||
virtual void GiveC4() = 0;
|
||||
virtual void ChangeLevel() = 0;
|
||||
virtual void GoToIntermission() = 0;
|
||||
|
||||
// Setup counts for m_iNumTerrorist, m_iNumCT, m_iNumSpawnableTerrorist, m_iNumSpawnableCT, etc.
|
||||
virtual void InitializePlayerCounts(int &NumAliveTerrorist, int &NumAliveCT, int &NumDeadTerrorist, int &NumDeadCT) = 0;
|
||||
|
||||
virtual void BalanceTeams() = 0;
|
||||
virtual void SwapAllPlayers() = 0;
|
||||
virtual void UpdateTeamScores() = 0;
|
||||
virtual void EndRoundMessage(const char *sentence, int event) = 0;
|
||||
virtual void SetAccountRules(RewardRules rules, int amount) = 0;
|
||||
|
||||
// BOMB MAP FUNCTIONS
|
||||
virtual BOOL IsThereABomber() = 0;
|
||||
virtual BOOL IsThereABomb() = 0;
|
||||
|
||||
virtual bool HasRoundTimeExpired() = 0;
|
||||
virtual bool IsBombPlanted() = 0;
|
||||
|
||||
public:
|
||||
bool ShouldSkipSpawn() const { return m_bSkipSpawn; }
|
||||
void MarkSpawnSkipped() { m_bSkipSpawn = false; }
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
template<typename t_ret, typename t_class, typename ...t_args>
|
||||
class IHookChainRegistryClass {
|
||||
public:
|
||||
typedef t_ret(*hookfunc_t)(IHookChain<t_ret, t_args...>*, t_class *, t_args...);
|
||||
typedef t_ret(*hookfunc_t)(IHookChainClass<t_ret, t_class, t_args...>*, t_class *, t_args...);
|
||||
|
||||
virtual void registerHook(hookfunc_t hook) = 0;
|
||||
virtual void unregisterHook(hookfunc_t hook) = 0;
|
||||
@ -103,7 +103,7 @@ public:
|
||||
template<typename t_class, typename ...t_args>
|
||||
class IVoidHookChainRegistryClass {
|
||||
public:
|
||||
typedef void(*hookfunc_t)(IVoidHookChain<t_args...>*, t_class *, t_args...);
|
||||
typedef void(*hookfunc_t)(IVoidHookChainClass<t_class, t_args...>*, t_class *, t_args...);
|
||||
|
||||
virtual void registerHook(hookfunc_t hook) = 0;
|
||||
virtual void unregisterHook(hookfunc_t hook) = 0;
|
||||
|
@ -161,10 +161,6 @@ typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHo
|
||||
typedef IVoidHookChainClass<class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
|
||||
typedef IVoidHookChainRegistryClass<class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// GetForceCamera hook
|
||||
typedef IHookChain<int, class CBasePlayer *> IReGameHook_GetForceCamera;
|
||||
typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_GetForceCamera;
|
||||
@ -391,7 +387,6 @@ struct ReGameFuncs_t {
|
||||
void (*ApplyMultiDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker);
|
||||
void (*AddMultiDamage)(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType);
|
||||
|
||||
void (*EndRoundMessage)(const char *sentence, int event);
|
||||
class CBaseEntity *(*UTIL_FindEntityByString)(class CBaseEntity *pStartEntity, const char *szKeyword, const char *szValue);
|
||||
};
|
||||
|
||||
|
@ -2715,7 +2715,7 @@ FunctionHook g_FunctionHooks[] =
|
||||
{ 0x01D8B400, "_Z21SV_CareerMatchLimit_fv", (size_t)&SV_CareerMatchLimit_f },
|
||||
{ 0x01D8B6E0, "_Z9BroadcastPKc", (size_t)&Broadcast },
|
||||
{ 0x01D8B780, "_Z7GetTeami", (size_t)&GetTeam },
|
||||
{ 0x01D8B7B0, "_Z15EndRoundMessagePKci", (size_t)&EndRoundMessage },
|
||||
//{ 0x01D8B7B0, "_Z15EndRoundMessagePKci", (size_t)&EndRoundMessage },
|
||||
//{ 0x01D8BD80, "_ZL18ReadMultiplayCvarsP18CHalfLifeMultiplay", (size_t)&ReadMultiplayCvars },
|
||||
//{ 0x01D92670, "_Z15DestroyMapCycleP10mapcycle_s", (size_t)&DestroyMapCycle }, // NOXREF
|
||||
{ 0x01D926B0, "_Z15MP_COM_GetTokenv", (size_t)&MP_COM_GetToken },
|
||||
|
@ -1488,7 +1488,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Full</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>REGAMEDLL_SELF;PLAY_GAMEDLL;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;NDEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>REGAMEDLL_SELF;PLAY_GAMEDLL;REGAMEDLL_API;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;NDEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<FloatingPointModel>Precise</FloatingPointModel>
|
||||
<AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
template<typename t_ret, typename t_class, typename ...t_args>
|
||||
class IHookChainRegistryClass {
|
||||
public:
|
||||
typedef t_ret(*hookfunc_t)(IHookChain<t_ret, t_args...>*, t_class *, t_args...);
|
||||
typedef t_ret(*hookfunc_t)(IHookChainClass<t_ret, t_class, t_args...>*, t_class *, t_args...);
|
||||
|
||||
virtual void registerHook(hookfunc_t hook) = 0;
|
||||
virtual void unregisterHook(hookfunc_t hook) = 0;
|
||||
@ -103,7 +103,7 @@ public:
|
||||
template<typename t_class, typename ...t_args>
|
||||
class IVoidHookChainRegistryClass {
|
||||
public:
|
||||
typedef void(*hookfunc_t)(IVoidHookChain<t_args...>*, t_class *, t_args...);
|
||||
typedef void(*hookfunc_t)(IVoidHookChainClass<t_class, t_args...>*, t_class *, t_args...);
|
||||
|
||||
virtual void registerHook(hookfunc_t hook) = 0;
|
||||
virtual void unregisterHook(hookfunc_t hook) = 0;
|
||||
|
@ -161,10 +161,6 @@ typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHo
|
||||
typedef IVoidHookChainClass<class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
|
||||
typedef IVoidHookChainRegistryClass<class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// GetForceCamera hook
|
||||
typedef IHookChain<int, class CBasePlayer *> IReGameHook_GetForceCamera;
|
||||
typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_GetForceCamera;
|
||||
@ -383,15 +379,11 @@ public:
|
||||
struct ReGameFuncs_t {
|
||||
class CBasePlayer *(*UTIL_PlayerByIndex)(int playerIndex);
|
||||
struct edict_s *(*CREATE_NAMED_ENTITY2)(string_t iClass);
|
||||
|
||||
void (*ChangeString)(char *&dest, const char *source);
|
||||
|
||||
void (*RadiusDamage)(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType);
|
||||
void (*ClearMultiDamage)();
|
||||
void (*ApplyMultiDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker);
|
||||
void (*AddMultiDamage)(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType);
|
||||
|
||||
void (*EndRoundMessage)(const char *sentence, int event);
|
||||
class CBaseEntity *(*UTIL_FindEntityByString)(class CBaseEntity *pStartEntity, const char *szKeyword, const char *szValue);
|
||||
};
|
||||
|
||||
@ -410,7 +402,6 @@ public:
|
||||
virtual struct playermove_s* GetPlayerMove() = 0;
|
||||
virtual struct WeaponSlotInfo* GetWeaponSlot(WeaponIdType weaponID) = 0;
|
||||
virtual struct WeaponSlotInfo* GetWeaponSlot(const char* weaponName) = 0;
|
||||
|
||||
};
|
||||
|
||||
#define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001"
|
||||
|
@ -78,7 +78,11 @@ public:
|
||||
virtual void SetBombIcon(bool bFlash = false);
|
||||
virtual void SetScoreAttrib(CBasePlayer *dest);
|
||||
virtual void SendItemStatus();
|
||||
virtual void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr);
|
||||
virtual void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false);
|
||||
virtual void Observer_SetMode(int iMode);
|
||||
virtual bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot);
|
||||
virtual bool SwitchWeapon(CBasePlayerItem *pWeapon);
|
||||
virtual void SwitchTeam();
|
||||
|
||||
CBasePlayer *BasePlayer() const;
|
||||
public:
|
||||
|
@ -280,7 +280,7 @@ public:
|
||||
template<typename t_ret, typename t_class, typename ...t_args>
|
||||
class IHookChainRegistryClassImpl : public IHookChainRegistryClass <t_ret, t_class, t_args...>, public AbstractHookChainRegistry {
|
||||
public:
|
||||
typedef t_ret(*hookfunc_t)(IHookChain<t_ret, t_args...>*, t_class *, t_args...);
|
||||
typedef t_ret(*hookfunc_t)(IHookChainClass<t_ret, t_class, t_args...>*, t_class *, t_args...);
|
||||
typedef t_ret(t_class::*origfunc_t)(t_args...);
|
||||
|
||||
virtual ~IHookChainRegistryClassImpl() { }
|
||||
@ -366,7 +366,7 @@ public:
|
||||
template<typename t_class, typename ...t_args>
|
||||
class IVoidHookChainRegistryClassImpl : public IVoidHookChainRegistryClass <t_class, t_args...>, public AbstractHookChainRegistry {
|
||||
public:
|
||||
typedef void(*hookfunc_t)(IVoidHookChain<t_args...>*, t_class *, t_args...);
|
||||
typedef void(*hookfunc_t)(IVoidHookChainClass<t_class, t_args...>*, t_class *, t_args...);
|
||||
typedef void(t_class::*origfunc_t)(t_args...);
|
||||
|
||||
virtual ~IVoidHookChainRegistryClassImpl() { }
|
||||
|
@ -40,7 +40,6 @@ ReGameFuncs_t g_ReGameApiFuncs = {
|
||||
&ApplyMultiDamage_api,
|
||||
&AddMultiDamage_api,
|
||||
|
||||
&EndRoundMessage,
|
||||
&UTIL_FindEntityByString,
|
||||
|
||||
};
|
||||
@ -76,8 +75,6 @@ IReGameHookRegistry_CBasePlayer_AddAccount* CReGameHookchains::CBasePlayer_AddAc
|
||||
IReGameHookRegistry_CBasePlayer_GiveShield* CReGameHookchains::CBasePlayer_GiveShield() { return &m_CBasePlayer_GiveShield; }
|
||||
IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel* CReGameHookchains::CBasePlayer_SetClientUserInfoModel() { return &m_CBasePlayer_SetClientUserInfoModel; }
|
||||
IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CReGameHookchains::CBasePlayer_SetClientUserInfoName() { return &m_CBasePlayer_SetClientUserInfoName; }
|
||||
|
||||
|
||||
IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CReGameHookchains::CBaseAnimating_ResetSequenceInfo() { return &m_CBaseAnimating_ResetSequenceInfo; }
|
||||
|
||||
IReGameHookRegistry_GetForceCamera* CReGameHookchains::GetForceCamera() { return &m_GetForceCamera; }
|
||||
|
@ -152,12 +152,10 @@ typedef IVoidHookChainRegistryClassImpl<CBasePlayer, char *, char *> CReGameHook
|
||||
typedef IVoidHookChainClassImpl<CBasePlayer, char *, char *> CReGameHook_CBasePlayer_SetClientUserInfoName;
|
||||
typedef IVoidHookChainRegistryClassImpl<CBasePlayer, char *, char *> CReGameHookRegistry_CBasePlayer_SetClientUserInfoName;
|
||||
|
||||
|
||||
// CBaseAnimating::ResetSequenceInfo hook
|
||||
typedef IVoidHookChainClassImpl<CBaseAnimating> CReGameHook_CBaseAnimating_ResetSequenceInfo;
|
||||
typedef IVoidHookChainRegistryClassImpl<CBaseAnimating> CReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
|
||||
|
||||
|
||||
// GetForceCamera hook
|
||||
typedef IHookChainImpl<int, class CBasePlayer *> CReGameHook_GetForceCamera;
|
||||
typedef IHookChainRegistryImpl<int, class CBasePlayer *> CReGameHookRegistry_GetForceCamera;
|
||||
@ -331,7 +329,7 @@ public:
|
||||
CReGameHookRegistry_CBasePlayer_AddAccount m_CBasePlayer_AddAccount;
|
||||
CReGameHookRegistry_CBasePlayer_GiveShield m_CBasePlayer_GiveShield;
|
||||
CReGameHookRegistry_CBasePlayer_SetClientUserInfoModel m_CBasePlayer_SetClientUserInfoModel;
|
||||
|
||||
CReGameHookRegistry_CBasePlayer_SetClientUserInfoName m_CBasePlayer_SetClientUserInfoName;
|
||||
CReGameHookRegistry_CBaseAnimating_ResetSequenceInfo m_CBaseAnimating_ResetSequenceInfo;
|
||||
|
||||
CReGameHookRegistry_GetForceCamera m_GetForceCamera;
|
||||
@ -371,7 +369,6 @@ public:
|
||||
CReGameHookRegistry_CSGameRules_GoToIntermission m_CSGameRules_GoToIntermission;
|
||||
CReGameHookRegistry_CSGameRules_BalanceTeams m_CSGameRules_BalanceTeams;
|
||||
|
||||
CReGameHookRegistry_CBasePlayer_SetClientUserInfoName m_CBasePlayer_SetClientUserInfoName;
|
||||
public:
|
||||
virtual IReGameHookRegistry_CBasePlayer_Spawn* CBasePlayer_Spawn();
|
||||
virtual IReGameHookRegistry_CBasePlayer_Precache* CBasePlayer_Precache();
|
||||
@ -403,7 +400,7 @@ public:
|
||||
virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount();
|
||||
virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield();
|
||||
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel* CBasePlayer_SetClientUserInfoModel();
|
||||
|
||||
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CBasePlayer_SetClientUserInfoName();
|
||||
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo();
|
||||
|
||||
virtual IReGameHookRegistry_GetForceCamera* GetForceCamera();
|
||||
@ -442,8 +439,6 @@ public:
|
||||
virtual IReGameHookRegistry_CSGameRules_ChangeLevel* CSGameRules_ChangeLevel();
|
||||
virtual IReGameHookRegistry_CSGameRules_GoToIntermission* CSGameRules_GoToIntermission();
|
||||
virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams();
|
||||
|
||||
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CBasePlayer_SetClientUserInfoName();
|
||||
};
|
||||
|
||||
extern CReGameHookchains g_ReGameHookchains;
|
||||
|
@ -84,4 +84,8 @@ edict_t *CCSPlayer::EntSelectSpawnPoint() { return BasePlayer()->EntSelectSpawnP
|
||||
void CCSPlayer::SendItemStatus() { BasePlayer()->SendItemStatus(); }
|
||||
void CCSPlayer::SetBombIcon(bool bFlash) { BasePlayer()->SetBombIcon(bFlash ? TRUE : FALSE); }
|
||||
void CCSPlayer::SetScoreAttrib(CBasePlayer *dest) { BasePlayer()->SetScoreAttrib(dest); }
|
||||
void CCSPlayer::ReloadWeapons(CBasePlayerItem *pWeapon) { BasePlayer()->ReloadWeapons(pWeapon); }
|
||||
void CCSPlayer::ReloadWeapons(CBasePlayerItem *pWeapon, bool bForceReload, bool bForceRefill) { BasePlayer()->ReloadWeapons(pWeapon, bForceReload, bForceRefill); }
|
||||
void CCSPlayer::Observer_SetMode(int iMode) { BasePlayer()->Observer_SetMode(iMode); }
|
||||
bool CCSPlayer::SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot) { return BasePlayer()->SelectSpawnSpot(pEntClassName, pSpot); }
|
||||
bool CCSPlayer::SwitchWeapon(CBasePlayerItem *pWeapon) { return BasePlayer()->SwitchWeapon(pWeapon) != FALSE; }
|
||||
void CCSPlayer::SwitchTeam() { BasePlayer()->SwitchTeam(); }
|
||||
|
Loading…
Reference in New Issue
Block a user