mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
CZero
: Fix broken Career Tasks (#836)
* Fix HandleEnemyKill params and Hostage target detection * Var name mistake * Grouping more code on FIXES macro
This commit is contained in:
parent
12560c2b87
commit
d4deabfe59
@ -136,10 +136,14 @@ void CCareerTask::OnWeaponKill(int weaponId, int weaponClassId, bool headshot, b
|
|||||||
if (!pHostage->IsAlive())
|
if (!pHostage->IsAlive())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#ifndef REGAMEDLL_FIXES
|
||||||
if (!pHostage->IsFollowingSomeone())
|
if (!pHostage->IsFollowingSomeone())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (pHostage->m_target == pVictim)
|
if (pHostage->m_target == pVictim)
|
||||||
|
#else
|
||||||
|
if (pHostage->IsFollowing(pVictim))
|
||||||
|
#endif
|
||||||
hostagesCount++;
|
hostagesCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,11 +215,14 @@ void CCareerTask::OnEvent(GameEventType event, CBasePlayer *pVictim, CBasePlayer
|
|||||||
{
|
{
|
||||||
if (!pHostage->IsAlive())
|
if (!pHostage->IsAlive())
|
||||||
continue;
|
continue;
|
||||||
|
#ifndef REGAMEDLL_FIXES
|
||||||
if (!pHostage->IsFollowingSomeone())
|
if (!pHostage->IsFollowingSomeone())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (pHostage->m_target == pAttacker)
|
if (pHostage->m_target == pAttacker)
|
||||||
|
#else
|
||||||
|
if (pHostage->IsFollowing(pAttacker))
|
||||||
|
#endif
|
||||||
hostagesCount++;
|
hostagesCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2046,8 +2046,27 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TheCareerTasks->HandleDeath(m_iTeam, this);
|
TheCareerTasks->HandleDeath(m_iTeam, this);
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (!m_bKilledByBomb)
|
||||||
|
{
|
||||||
|
CBasePlayer *pAttacker = CBasePlayer::Instance(pevAttacker);
|
||||||
|
|
||||||
|
if(pAttacker /*safety*/ && !pAttacker->IsBot() && pAttacker->m_iTeam != m_iTeam)
|
||||||
|
{
|
||||||
|
if (pAttacker->HasShield())
|
||||||
|
killerHasShield = true;
|
||||||
|
|
||||||
|
if (IsBot() && IsBlind()) // dystopm: shouldn't be !IsBot() ?
|
||||||
|
wasBlind = true;
|
||||||
|
|
||||||
|
TheCareerTasks->HandleEnemyKill(wasBlind, GetWeaponName(g_pevLastInflictor, pevAttacker), m_bHeadshotKilled, killerHasShield, pAttacker, this); // last 2 param swapped to match function definition
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef REGAMEDLL_FIXES
|
||||||
if (!m_bKilledByBomb)
|
if (!m_bKilledByBomb)
|
||||||
{
|
{
|
||||||
CBasePlayer *pAttacker = CBasePlayer::Instance(pevAttacker);
|
CBasePlayer *pAttacker = CBasePlayer::Instance(pevAttacker);
|
||||||
@ -2077,6 +2096,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_bKilledByBomb)
|
if (!m_bKilledByBomb)
|
||||||
|
Loading…
Reference in New Issue
Block a user