mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-06-12 05:42:06 +03:00
fix: Reset immunity effects always (#788)
* Reset immunity effects always * add new member m_bSpawnProtectionEffects
This commit is contained in:
parent
cf8deb9cac
commit
980162774a
@ -541,6 +541,7 @@ void CCSPlayer::Reset()
|
|||||||
m_bGameForcingRespawn = false;
|
m_bGameForcingRespawn = false;
|
||||||
m_bAutoBunnyHopping = false;
|
m_bAutoBunnyHopping = false;
|
||||||
m_bMegaBunnyJumping = false;
|
m_bMegaBunnyJumping = false;
|
||||||
|
m_bSpawnProtectionEffects = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCSPlayer::OnSpawn()
|
void CCSPlayer::OnSpawn()
|
||||||
|
@ -10247,6 +10247,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(SetSpawnProtection)(float flProtectionTime
|
|||||||
#ifdef REGAMEDLL_ADD
|
#ifdef REGAMEDLL_ADD
|
||||||
if (respawn_immunity_effects.value > 0)
|
if (respawn_immunity_effects.value > 0)
|
||||||
{
|
{
|
||||||
|
CSPlayer()->m_bSpawnProtectionEffects = true;
|
||||||
pev->rendermode = kRenderTransAdd;
|
pev->rendermode = kRenderTransAdd;
|
||||||
pev->renderamt = 100.0f;
|
pev->renderamt = 100.0f;
|
||||||
|
|
||||||
@ -10268,12 +10269,11 @@ LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, RemoveSpawnProtection)
|
|||||||
void CBasePlayer::__API_HOOK(RemoveSpawnProtection)()
|
void CBasePlayer::__API_HOOK(RemoveSpawnProtection)()
|
||||||
{
|
{
|
||||||
#ifdef REGAMEDLL_ADD
|
#ifdef REGAMEDLL_ADD
|
||||||
if (respawn_immunity_effects.value > 0)
|
if (CSPlayer()->m_bSpawnProtectionEffects)
|
||||||
{
|
{
|
||||||
if (pev->rendermode == kRenderTransAdd &&
|
if (pev->rendermode == kRenderTransAdd && pev->renderamt == 100.0f)
|
||||||
pev->renderamt == 100.0f)
|
|
||||||
{
|
{
|
||||||
pev->renderamt = 255.0f;
|
pev->renderamt = 255.0f;
|
||||||
pev->rendermode = kRenderNormal;
|
pev->rendermode = kRenderNormal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10281,6 +10281,8 @@ void CBasePlayer::__API_HOOK(RemoveSpawnProtection)()
|
|||||||
WRITE_BYTE(STATUSICON_HIDE);
|
WRITE_BYTE(STATUSICON_HIDE);
|
||||||
WRITE_STRING("suithelmet_full");
|
WRITE_STRING("suithelmet_full");
|
||||||
MESSAGE_END();
|
MESSAGE_END();
|
||||||
|
|
||||||
|
CSPlayer()->m_bSpawnProtectionEffects = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSPlayer()->m_flSpawnProtectionEndTime = 0.0f;
|
CSPlayer()->m_flSpawnProtectionEndTime = 0.0f;
|
||||||
|
@ -49,7 +49,8 @@ public:
|
|||||||
m_bGameForcingRespawn(false),
|
m_bGameForcingRespawn(false),
|
||||||
m_bAutoBunnyHopping(false),
|
m_bAutoBunnyHopping(false),
|
||||||
m_bMegaBunnyJumping(false),
|
m_bMegaBunnyJumping(false),
|
||||||
m_bPlantC4Anywhere(false)
|
m_bPlantC4Anywhere(false),
|
||||||
|
m_bSpawnProtectionEffects(false)
|
||||||
{
|
{
|
||||||
m_szModel[0] = '\0';
|
m_szModel[0] = '\0';
|
||||||
}
|
}
|
||||||
@ -131,6 +132,7 @@ public:
|
|||||||
bool m_bAutoBunnyHopping;
|
bool m_bAutoBunnyHopping;
|
||||||
bool m_bMegaBunnyJumping;
|
bool m_bMegaBunnyJumping;
|
||||||
bool m_bPlantC4Anywhere;
|
bool m_bPlantC4Anywhere;
|
||||||
|
bool m_bSpawnProtectionEffects;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Inlines
|
// Inlines
|
||||||
|
Loading…
x
Reference in New Issue
Block a user