mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-28 22:48:02 +03:00
Fix: CleanUpMap before the players spawn.
Fix: ValveSoftware/halflife#1567
This commit is contained in:
parent
b032bedf95
commit
1423f7e3fa
@ -1940,6 +1940,11 @@ void CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
|
|||||||
m_iLoserBonus = m_rgRewardAccountRules[RR_LOSER_BONUS_DEFAULT];
|
m_iLoserBonus = m_rgRewardAccountRules[RR_LOSER_BONUS_DEFAULT];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// Respawn entities (glass, doors, etc..)
|
||||||
|
CleanUpMap();
|
||||||
|
#endif
|
||||||
|
|
||||||
// tell bots that the round is restarting
|
// tell bots that the round is restarting
|
||||||
CBaseEntity *pPlayer = NULL;
|
CBaseEntity *pPlayer = NULL;
|
||||||
while ((pPlayer = UTIL_FindEntityByClassname(pPlayer, "player")) != NULL)
|
while ((pPlayer = UTIL_FindEntityByClassname(pPlayer, "player")) != NULL)
|
||||||
@ -1987,11 +1992,17 @@ void CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
|
|||||||
|
|
||||||
if (player->m_iTeam != UNASSIGNED && player->m_iTeam != SPECTATOR)
|
if (player->m_iTeam != UNASSIGNED && player->m_iTeam != SPECTATOR)
|
||||||
{
|
{
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// remove the c4 if the player is carrying it
|
||||||
|
if (player->m_bHasC4) {
|
||||||
|
player->RemoveBomb();
|
||||||
|
}
|
||||||
|
#else
|
||||||
// drop the c4 if the player is carrying it
|
// drop the c4 if the player is carrying it
|
||||||
if (player->m_bHasC4)
|
if (player->m_bHasC4) {
|
||||||
{
|
|
||||||
player->DropPlayerItem("weapon_c4");
|
player->DropPlayerItem("weapon_c4");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
player->RoundRespawn();
|
player->RoundRespawn();
|
||||||
}
|
}
|
||||||
@ -2001,8 +2012,10 @@ void CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
|
|||||||
// for EVERY player (regardless of what team they're on)
|
// for EVERY player (regardless of what team they're on)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Respawn entities (glass, doors, etc..)
|
// Moved above the loop spawning the players
|
||||||
|
#ifndef REGAMEDLL_FIXES
|
||||||
CleanUpMap();
|
CleanUpMap();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Give C4 to the terrorists
|
// Give C4 to the terrorists
|
||||||
if (m_bMapHasBombTarget)
|
if (m_bMapHasBombTarget)
|
||||||
|
@ -6006,8 +6006,14 @@ void CBasePlayer::FlashlightTurnOff()
|
|||||||
|
|
||||||
void CBasePlayer::ForceClientDllUpdate()
|
void CBasePlayer::ForceClientDllUpdate()
|
||||||
{
|
{
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// fix for https://github.com/ValveSoftware/halflife/issues/1567
|
||||||
|
m_iClientHideHUD = -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
m_iClientHealth = -1;
|
m_iClientHealth = -1;
|
||||||
m_iClientBattery = -1;
|
m_iClientBattery = -1;
|
||||||
|
|
||||||
m_fWeapon = FALSE;
|
m_fWeapon = FALSE;
|
||||||
m_fInitHUD = TRUE;
|
m_fInitHUD = TRUE;
|
||||||
m_iTrain |= TRAIN_NEW;
|
m_iTrain |= TRAIN_NEW;
|
||||||
@ -6786,6 +6792,17 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(UpdateClientData)()
|
|||||||
WRITE_SHORT(CSGameRules()->m_iNumTerroristWins);
|
WRITE_SHORT(CSGameRules()->m_iNumTerroristWins);
|
||||||
MESSAGE_END();
|
MESSAGE_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// send "flashlight" update message
|
||||||
|
if (FlashlightIsOn())
|
||||||
|
{
|
||||||
|
MESSAGE_BEGIN(MSG_ONE, gmsgFlashlight, NULL, pev);
|
||||||
|
WRITE_BYTE(1);
|
||||||
|
WRITE_BYTE(m_iFlashBattery);
|
||||||
|
MESSAGE_END();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_iHideHUD != m_iClientHideHUD)
|
if (m_iHideHUD != m_iClientHideHUD)
|
||||||
@ -9442,3 +9459,38 @@ void CBasePlayer::DropPrimary()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CBasePlayerItem *CBasePlayer::GetItemOfNamed(const char *pszItemName)
|
||||||
|
{
|
||||||
|
for (auto pItem : m_rgpPlayerItems) {
|
||||||
|
while (pItem) {
|
||||||
|
if (FClassnameIs(pItem->pev, pszItemName))
|
||||||
|
return pItem;
|
||||||
|
|
||||||
|
pItem = pItem->m_pNext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CBasePlayer::RemoveBomb()
|
||||||
|
{
|
||||||
|
auto pBomb = GetItemOfNamed("weapon_c4");
|
||||||
|
if (!pBomb)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_bHasC4 = false;
|
||||||
|
pev->body = 0;
|
||||||
|
SetBombIcon(FALSE);
|
||||||
|
SetProgressBarTime(0);
|
||||||
|
|
||||||
|
if (m_pActiveItem == pBomb) {
|
||||||
|
((CBasePlayerWeapon *)pBomb)->RetireWeapon();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RemovePlayerItem(pBomb)) {
|
||||||
|
pev->weapons &= ~(1 << pBomb->m_iId);
|
||||||
|
pBomb->Kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -603,6 +603,9 @@ public:
|
|||||||
void DropSecondary();
|
void DropSecondary();
|
||||||
void DropPrimary();
|
void DropPrimary();
|
||||||
|
|
||||||
|
void RemoveBomb();
|
||||||
|
CBasePlayerItem *GetItemOfNamed(const char *pszItemName);
|
||||||
|
|
||||||
#ifdef REGAMEDLL_ADD
|
#ifdef REGAMEDLL_ADD
|
||||||
CCSPlayer *CSPlayer() const;
|
CCSPlayer *CSPlayer() const;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user