Fix typo with virtual function CPathCorner::GetDelay

This commit is contained in:
s1lentq 2016-02-29 22:00:29 +06:00
parent ba1e521f89
commit cbd030e72a
7 changed files with 16 additions and 23 deletions

View File

@ -913,6 +913,7 @@ int CBaseEntity::__MAKE_VHOOK(Restore)(CRestore &restore)
return status; return status;
} }
// Initialize absmin & absmax to the appropriate box
void SetObjectCollisionBox(entvars_t *pev) void SetObjectCollisionBox(entvars_t *pev)
{ {
if ((pev->solid == SOLID_BSP) && (pev->angles.x || pev->angles.y || pev->angles.z)) if ((pev->solid == SOLID_BSP) && (pev->angles.x || pev->angles.y || pev->angles.z))

View File

@ -39,6 +39,7 @@ public:
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save); virtual int Save(CSave &save);
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual float GetDelay() { return m_flWait; }
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -49,8 +50,6 @@ public:
#endif #endif
float GetDelay() const { return m_flWait; }
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1]; static TYPEDESCRIPTION IMPL(m_SaveData)[1];

View File

@ -426,7 +426,6 @@ void CFuncPlat::__MAKE_VHOOK(GoDown)()
} }
assert(m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP); assert(m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP);
m_toggle_state = TS_GOING_DOWN; m_toggle_state = TS_GOING_DOWN;
SetMoveDone(&CFuncPlat::CallHitBottom); SetMoveDone(&CFuncPlat::CallHitBottom);
LinearMove(m_vecPosition2, pev->speed); LinearMove(m_vecPosition2, pev->speed);
@ -446,7 +445,6 @@ void CFuncPlat::__MAKE_VHOOK(HitBottom)()
} }
assert(m_toggle_state == TS_GOING_DOWN); assert(m_toggle_state == TS_GOING_DOWN);
m_toggle_state = TS_AT_BOTTOM; m_toggle_state = TS_AT_BOTTOM;
} }
@ -459,7 +457,6 @@ void CFuncPlat::__MAKE_VHOOK(GoUp)()
} }
assert(m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN); assert(m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN);
m_toggle_state = TS_GOING_UP; m_toggle_state = TS_GOING_UP;
SetMoveDone(&CFuncPlat::CallHitTop); SetMoveDone(&CFuncPlat::CallHitTop);
LinearMove(m_vecPosition1, pev->speed); LinearMove(m_vecPosition1, pev->speed);
@ -479,7 +476,6 @@ void CFuncPlat::__MAKE_VHOOK(HitTop)()
} }
assert(m_toggle_state == TS_GOING_UP); assert(m_toggle_state == TS_GOING_UP);
m_toggle_state = TS_AT_TOP; m_toggle_state = TS_AT_TOP;
if (!IsTogglePlat()) if (!IsTogglePlat())
@ -612,7 +608,6 @@ void CFuncTrain::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
return; return;
m_flActivateFinished = gpGlobals->time + 0.5f; m_flActivateFinished = gpGlobals->time + 0.5f;
pOther->TakeDamage(pev, pev, pev->dmg, DMG_CRUSH); pOther->TakeDamage(pev, pev, pev->dmg, DMG_CRUSH);
} }
@ -723,7 +718,6 @@ void CFuncTrain::Next()
// Save last target in case we need to find it again // Save last target in case we need to find it again
pev->message = pev->target; pev->message = pev->target;
pev->target = pTarg->pev->target; pev->target = pTarg->pev->target;
m_flWait = pTarg->GetDelay(); m_flWait = pTarg->GetDelay();
@ -745,7 +739,7 @@ void CFuncTrain::Next()
// Path corner has indicated a teleport to the next corner. // Path corner has indicated a teleport to the next corner.
pev->effects |= EF_NOINTERP; pev->effects |= EF_NOINTERP;
UTIL_SetOrigin(pev, pTarg->pev->origin - (pev->mins + pev->maxs) * 0.5); UTIL_SetOrigin(pev, pTarg->pev->origin - (pev->mins + pev->maxs) * 0.5f);
// Get on with doing the next path corner. // Get on with doing the next path corner.
Wait(); Wait();
@ -784,7 +778,7 @@ void CFuncTrain::__MAKE_VHOOK(Activate)()
// keep track of this since path corners change our target for us. // keep track of this since path corners change our target for us.
m_pevCurrentTarget = pevTarg; m_pevCurrentTarget = pevTarg;
UTIL_SetOrigin(pev, pevTarg->origin - (pev->mins + pev->maxs) * 0.5); UTIL_SetOrigin(pev, pevTarg->origin - (pev->mins + pev->maxs) * 0.5f);
if (FStringNull(pev->targetname)) if (FStringNull(pev->targetname))
{ {
@ -1066,7 +1060,7 @@ void CFuncTrackTrain::UpdateSound()
if (!pev->noise) if (!pev->noise)
return; return;
flpitch = TRAIN_STARTPITCH + (Q_abs(pev->speed) * (TRAIN_MAXPITCH - TRAIN_STARTPITCH) / TRAIN_MAXSPEED); flpitch = TRAIN_STARTPITCH + (Q_abs(int(pev->speed)) * (TRAIN_MAXPITCH - TRAIN_STARTPITCH) / TRAIN_MAXSPEED);
if (!m_soundPlaying) if (!m_soundPlaying)
{ {

View File

@ -4940,7 +4940,7 @@ edict_t *EntSelectSpawnPoint(CBaseEntity *pPlayer)
ReturnSpot: ReturnSpot:
if (FNullEnt(pSpot)) if (FNullEnt(pSpot))
{ {
ALERT(at_error, "PutClientInServer: no info_player_start on level"); ALERT(at_error, "PutClientInServer: no info_player_start on level\n");
return INDEXENT(0); return INDEXENT(0);
} }

View File

@ -5,6 +5,9 @@
*/ */
#ifndef HOOK_GAMEDLL #ifndef HOOK_GAMEDLL
bool s_tutorDisabledThisGame = false;
float s_nextCvarCheckTime = 0.0f;
cvar_t cv_tutor_message_repeats = { "_tutor_message_repeats", "5", FCVAR_SERVER, 0.0f, NULL }; cvar_t cv_tutor_message_repeats = { "_tutor_message_repeats", "5", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_tutor_debug_level = { "_tutor_debug_level", "0", FCVAR_SERVER, 0.0f, NULL }; cvar_t cv_tutor_debug_level = { "_tutor_debug_level", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_tutor_view_distance = { "_tutor_view_distance", "1000", FCVAR_SERVER, 0.0f, NULL }; cvar_t cv_tutor_view_distance = { "_tutor_view_distance", "1000", FCVAR_SERVER, 0.0f, NULL };
@ -18,9 +21,6 @@ cvar_t cv_tutor_hint_interval_time = { "_tutor_hint_interval_time", "10.0", FCVA
#endif #endif
bool s_tutorDisabledThisGame;
float s_nextCvarCheckTime;
void InstallTutor(bool start) void InstallTutor(bool start)
{ {
if (TheTutor != NULL) if (TheTutor != NULL)
@ -66,9 +66,7 @@ void MonitorTutorStatus()
int numHumans = 0; int numHumans = 0;
if (!tutor_enableCvarExists || s_nextCvarCheckTime > gpGlobals->time) if (!tutor_enableCvarExists || s_nextCvarCheckTime > gpGlobals->time)
{
return; return;
}
if (tutor_enable != NULL || (tutor_enable = CVAR_GET_POINTER("tutor_enable")) != NULL) if (tutor_enable != NULL || (tutor_enable = CVAR_GET_POINTER("tutor_enable")) != NULL)
{ {
@ -84,11 +82,9 @@ void MonitorTutorStatus()
{ {
CBasePlayer *pPlayer = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i)); CBasePlayer *pPlayer = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
if (pPlayer && !pPlayer->IsBot()) if (pPlayer != NULL && !pPlayer->IsBot())
{
++numHumans; ++numHumans;
} }
}
if (shouldTutorBeOn) if (shouldTutorBeOn)
{ {

View File

@ -232,6 +232,9 @@ char theDebugBuffer[ DebugBufferSize ];
char *const g_TutorStateStrings[20]; char *const g_TutorStateStrings[20];
const char *TutorIdentifierList[150]; const char *TutorIdentifierList[150];
bool s_tutorDisabledThisGame;
float s_nextCvarCheckTime;
cvar_t cv_tutor_message_repeats; cvar_t cv_tutor_message_repeats;
cvar_t cv_tutor_debug_level; cvar_t cv_tutor_debug_level;
cvar_t cv_tutor_view_distance; cvar_t cv_tutor_view_distance;