mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-26 22:55:41 +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())
|
||||
continue;
|
||||
|
||||
#ifndef REGAMEDLL_FIXES
|
||||
if (!pHostage->IsFollowingSomeone())
|
||||
continue;
|
||||
|
||||
if (pHostage->m_target == pVictim)
|
||||
#else
|
||||
if (pHostage->IsFollowing(pVictim))
|
||||
#endif
|
||||
hostagesCount++;
|
||||
}
|
||||
|
||||
@ -211,11 +215,14 @@ void CCareerTask::OnEvent(GameEventType event, CBasePlayer *pVictim, CBasePlayer
|
||||
{
|
||||
if (!pHostage->IsAlive())
|
||||
continue;
|
||||
|
||||
#ifndef REGAMEDLL_FIXES
|
||||
if (!pHostage->IsFollowingSomeone())
|
||||
continue;
|
||||
|
||||
if (pHostage->m_target == pAttacker)
|
||||
#else
|
||||
if (pHostage->IsFollowing(pAttacker))
|
||||
#endif
|
||||
hostagesCount++;
|
||||
}
|
||||
|
||||
|
@ -2046,8 +2046,27 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib)
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user