diff --git a/regamedll/dlls/cbase.cpp b/regamedll/dlls/cbase.cpp index 9ac5ba3e..77293413 100644 --- a/regamedll/dlls/cbase.cpp +++ b/regamedll/dlls/cbase.cpp @@ -913,6 +913,7 @@ int CBaseEntity::__MAKE_VHOOK(Restore)(CRestore &restore) return status; } +// Initialize absmin & absmax to the appropriate box void SetObjectCollisionBox(entvars_t *pev) { if ((pev->solid == SOLID_BSP) && (pev->angles.x || pev->angles.y || pev->angles.z)) diff --git a/regamedll/dlls/cbase.h b/regamedll/dlls/cbase.h index f3944783..45146f7c 100644 --- a/regamedll/dlls/cbase.h +++ b/regamedll/dlls/cbase.h @@ -293,7 +293,7 @@ public: virtual BOOL IsAlive() { return (pev->deadflag == DEAD_NO && pev->health > 0.0f); } virtual BOOL IsBSPModel() { return (pev->solid == SOLID_BSP || pev->movetype == MOVETYPE_PUSHSTEP); } virtual BOOL ReflectGauss() { return (IsBSPModel() && pev->takedamage == DAMAGE_NO); } - virtual BOOL HasTarget(string_t targetname) { return FStrEq(STRING(targetname),STRING(pev->targetname)); } + virtual BOOL HasTarget(string_t targetname) { return FStrEq(STRING(targetname), STRING(pev->targetname)); } virtual BOOL IsInWorld(); virtual BOOL IsPlayer() { return FALSE; } virtual BOOL IsNetClient() { return FALSE; } diff --git a/regamedll/dlls/pathcorner.h b/regamedll/dlls/pathcorner.h index cfcbd893..069dc2cd 100644 --- a/regamedll/dlls/pathcorner.h +++ b/regamedll/dlls/pathcorner.h @@ -39,6 +39,7 @@ public: virtual void KeyValue(KeyValueData *pkvd); virtual int Save(CSave &save); virtual int Restore(CRestore &restore); + virtual float GetDelay() { return m_flWait; } #ifdef HOOK_GAMEDLL @@ -49,8 +50,6 @@ public: #endif - float GetDelay() const { return m_flWait; } - public: static TYPEDESCRIPTION IMPL(m_SaveData)[1]; diff --git a/regamedll/dlls/plats.cpp b/regamedll/dlls/plats.cpp index 0d0d5cc8..3a3486a7 100644 --- a/regamedll/dlls/plats.cpp +++ b/regamedll/dlls/plats.cpp @@ -426,7 +426,6 @@ void CFuncPlat::__MAKE_VHOOK(GoDown)() } assert(m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP); - m_toggle_state = TS_GOING_DOWN; SetMoveDone(&CFuncPlat::CallHitBottom); LinearMove(m_vecPosition2, pev->speed); @@ -446,7 +445,6 @@ void CFuncPlat::__MAKE_VHOOK(HitBottom)() } assert(m_toggle_state == TS_GOING_DOWN); - 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); - m_toggle_state = TS_GOING_UP; SetMoveDone(&CFuncPlat::CallHitTop); LinearMove(m_vecPosition1, pev->speed); @@ -479,7 +476,6 @@ void CFuncPlat::__MAKE_VHOOK(HitTop)() } assert(m_toggle_state == TS_GOING_UP); - m_toggle_state = TS_AT_TOP; if (!IsTogglePlat()) @@ -612,7 +608,6 @@ void CFuncTrain::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther) return; m_flActivateFinished = gpGlobals->time + 0.5f; - 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 pev->message = pev->target; - pev->target = pTarg->pev->target; m_flWait = pTarg->GetDelay(); @@ -737,7 +731,7 @@ void CFuncTrain::Next() // keep track of this since path corners change our target for us. m_pevCurrentTarget = pTarg->pev; - //hack + // hack pev->enemy = pTarg->edict(); if (m_pevCurrentTarget->spawnflags & SF_CORNER_TELEPORT) @@ -745,7 +739,7 @@ void CFuncTrain::Next() // Path corner has indicated a teleport to the next corner. 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. Wait(); @@ -784,7 +778,7 @@ void CFuncTrain::__MAKE_VHOOK(Activate)() // keep track of this since path corners change our target for us. 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)) { @@ -1048,7 +1042,7 @@ void CFuncTrackTrain::StopSound() if (m_soundPlaying && pev->noise) { unsigned short us_encode; - unsigned short us_sound = ((unsigned short)(m_sounds) & 0x0007) << 12; + unsigned short us_sound = ((unsigned short)(m_sounds) & 0x0007) << 12; us_encode = us_sound; @@ -1066,7 +1060,7 @@ void CFuncTrackTrain::UpdateSound() if (!pev->noise) 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) { diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index bb8b1334..e995f84f 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -4940,7 +4940,7 @@ CTSpawn: ReturnSpot: 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); } diff --git a/regamedll/dlls/tutor.cpp b/regamedll/dlls/tutor.cpp index 36e75167..e2c16204 100644 --- a/regamedll/dlls/tutor.cpp +++ b/regamedll/dlls/tutor.cpp @@ -5,6 +5,9 @@ */ #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_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 }; @@ -18,9 +21,6 @@ cvar_t cv_tutor_hint_interval_time = { "_tutor_hint_interval_time", "10.0", FCVA #endif -bool s_tutorDisabledThisGame; -float s_nextCvarCheckTime; - void InstallTutor(bool start) { if (TheTutor != NULL) @@ -66,9 +66,7 @@ void MonitorTutorStatus() int numHumans = 0; if (!tutor_enableCvarExists || s_nextCvarCheckTime > gpGlobals->time) - { return; - } if (tutor_enable != NULL || (tutor_enable = CVAR_GET_POINTER("tutor_enable")) != NULL) { @@ -84,10 +82,8 @@ void MonitorTutorStatus() { CBasePlayer *pPlayer = static_cast(UTIL_PlayerByIndex(i)); - if (pPlayer && !pPlayer->IsBot()) - { + if (pPlayer != NULL && !pPlayer->IsBot()) ++numHumans; - } } if (shouldTutorBeOn) diff --git a/regamedll/hookers/hooker_impl.cpp b/regamedll/hookers/hooker_impl.cpp index a230ee5a..edb1d3ec 100644 --- a/regamedll/hookers/hooker_impl.cpp +++ b/regamedll/hookers/hooker_impl.cpp @@ -232,6 +232,9 @@ char theDebugBuffer[ DebugBufferSize ]; char *const g_TutorStateStrings[20]; const char *TutorIdentifierList[150]; +bool s_tutorDisabledThisGame; +float s_nextCvarCheckTime; + cvar_t cv_tutor_message_repeats; cvar_t cv_tutor_debug_level; cvar_t cv_tutor_view_distance;