replaced wrong naming for global variable

This commit is contained in:
jeefo 2015-06-30 00:52:20 +03:00
commit f19e4e9e7f
5 changed files with 13 additions and 13 deletions

View file

@ -76,7 +76,7 @@ extern TaskItem g_taskFilters[];
extern Experience *g_experienceData;
extern edict_t *g_hostEntity;
extern edict_t *g_worldEdict;
extern edict_t *g_worldEntity;
extern Library *g_gameLib;
extern gamefuncs_t g_functionTable;
@ -105,17 +105,17 @@ static inline int GetMaxClients (void)
static inline edict_t *EntityOfIndex (const int index)
{
return static_cast <edict_t *> (g_worldEdict + index);
return static_cast <edict_t *> (g_worldEntity + index);
};
static inline int IndexOfEntity(const edict_t *ent)
{
return static_cast <int> (ent - g_worldEdict);
return static_cast <int> (ent - g_worldEntity);
};
static inline int EntOffsetOfEntity(const edict_t *ent)
{
return (char *) ent - (char *) g_worldEdict;
return (char *) ent - (char *) g_worldEntity;
}
static inline bool IsEntityNull (const edict_t *ent)

View file

@ -2022,7 +2022,7 @@ void Bot::SetConditions (void)
TraceResult tr;
TraceLine (EyePosition (), m_lastEnemyOrigin, true, GetEntity (), &tr);
if ((pev->origin - m_lastEnemyOrigin).GetLength () < 1600.0 && (tr.flFraction >= 0.2 || tr.pHit != g_worldEdict))
if ((pev->origin - m_lastEnemyOrigin).GetLength () < 1600.0 && (tr.flFraction >= 0.2 || tr.pHit != g_worldEntity))
{
m_aimFlags |= AIM_PREDICT_PATH;
@ -2926,7 +2926,7 @@ void Bot::ChooseAimDirection (void)
{
TraceLine (EyePosition (), m_lastEnemyOrigin, false, true, GetEntity (), &tr);
if (tr.flFraction <= 0.2 && tr.pHit == g_worldEdict)
if (tr.flFraction <= 0.2 && tr.pHit == g_worldEntity)
{
if ((m_aimFlags & (AIM_LAST_ENEMY | AIM_PREDICT_PATH)) && m_wantsToFire)
m_wantsToFire = false;
@ -2987,7 +2987,7 @@ void Bot::ChooseAimDirection (void)
}
else if (flags & AIM_PREDICT_PATH)
{
if (((pev->origin - m_lastEnemyOrigin).GetLength () < 1600 || UsesSniper ()) && (((tr.flFraction >= 0.2 || tr.pHit != g_worldEdict) && tracelineIssued) || !tracelineIssued))
if (((pev->origin - m_lastEnemyOrigin).GetLength () < 1600 || UsesSniper ()) && (((tr.flFraction >= 0.2 || tr.pHit != g_worldEntity) && tracelineIssued) || !tracelineIssued))
{
bool recalcPath = true;
@ -3034,7 +3034,7 @@ void Bot::ChooseAimDirection (void)
const Vector &dest = g_waypoint->GetPath ((g_experienceData + (index * g_numWaypoints) + index)->team0DangerIndex)->origin;
TraceLine (pev->origin, dest, true, GetEntity (), &tr);
if (tr.flFraction > 0.8 || tr.pHit != g_worldEdict)
if (tr.flFraction > 0.8 || tr.pHit != g_worldEntity)
m_lookAt = dest + pev->view_ofs;
}
}
@ -3045,7 +3045,7 @@ void Bot::ChooseAimDirection (void)
const Vector &dest = g_waypoint->GetPath ((g_experienceData + (index * g_numWaypoints) + index)->team1DangerIndex)->origin;
TraceLine (pev->origin, dest, true, GetEntity (), &tr);
if (tr.flFraction > 0.8 || tr.pHit != g_worldEdict)
if (tr.flFraction > 0.8 || tr.pHit != g_worldEntity)
m_lookAt = dest + pev->view_ofs;
}
}
@ -3060,7 +3060,7 @@ void Bot::ChooseAimDirection (void)
// trace forward
TraceLine (m_destOrigin, m_destOrigin + ((m_destOrigin - path->origin).Normalize () * 96), true, GetEntity (), &tr);
if (tr.flFraction < 1.0 && tr.pHit == g_worldEdict)
if (tr.flFraction < 1.0 && tr.pHit == g_worldEntity)
m_lookAt = path->origin + pev->view_ofs;
}
}

View file

@ -458,7 +458,7 @@ bool Bot::IsFriendInLineOfFire (float distance)
TraceLine (EyePosition (), EyePosition () + 10000.0f * pev->v_angle, false, false, GetEntity (), &tr);
// check if we hit something
if (!IsEntityNull (tr.pHit) && tr.pHit != g_worldEdict)
if (!IsEntityNull (tr.pHit) && tr.pHit != g_worldEntity)
{
int playerIndex = IndexOfEntity (tr.pHit) - 1;

View file

@ -73,7 +73,7 @@ enginefuncs_t g_engfuncs;
Client g_clients[32];
WeaponProperty g_weaponDefs[MAX_WEAPONS + 1];
edict_t *g_worldEdict = NULL;
edict_t *g_worldEntity = NULL;
edict_t *g_hostEntity = NULL;
globalvars_t *g_pGlobals = NULL;
Experience *g_experienceData = NULL;

View file

@ -956,7 +956,7 @@ int Spawn (edict_t *ent)
if (strcmp (STRING (ent->v.classname), "worldspawn") == 0)
{
g_worldEdict = ent; // save the world entity for future use
g_worldEntity = ent; // save the world entity for future use
g_convarWrapper->PushRegisteredConVarsToEngine (true);