diff --git a/regamedll/dlls/doors.cpp b/regamedll/dlls/doors.cpp index 6fff226d..6c11a9b4 100644 --- a/regamedll/dlls/doors.cpp +++ b/regamedll/dlls/doors.cpp @@ -522,7 +522,7 @@ void CBaseDoor::DoorGoUp() // BUGBUG: Triggered doors don't work with this yet if (FClassnameIs(pev, "func_door_rotating")) { - float sign = 1.0; + float sign = 1.0f; if (m_hActivator) { @@ -614,7 +614,9 @@ void CBaseDoor::DoorGoUp() AngularMove(m_vecAngle2 * sign, pev->speed); } else + { LinearMove(m_vecPosition2, pev->speed); + } } // The door has reached the "up" position. Either go back down, or wait for another activation. @@ -697,7 +699,9 @@ void CBaseDoor::DoorGoDown() AngularMove(m_vecAngle1, pev->speed); } else + { LinearMove(m_vecPosition1, pev->speed); + } } // The door has reached the "down" position. Back to quiescence. @@ -869,11 +873,11 @@ void CRotDoor::Restart() if (pev->speed == 0) pev->speed = 100; + // DOOR_START_OPEN is to allow an entity to be lighted in the closed position + // but spawn in the open position if (pev->spawnflags & SF_DOOR_START_OPEN) { -#ifdef REGAMEDLL_FIXES - pev->angles = m_vecAngle1; -#else +#ifndef REGAMEDLL_FIXES pev->angles = m_vecAngle2; Vector vecSav = m_vecAngle1; @@ -884,6 +888,10 @@ void CRotDoor::Restart() pev->movedir = pev->movedir * -1; } +#ifdef REGAMEDLL_FIXES + pev->angles = m_vecAngle1; +#endif + m_toggle_state = TS_AT_BOTTOM; DoorGoDown(); } diff --git a/regamedll/dlls/subs.cpp b/regamedll/dlls/subs.cpp index 2c0fe90e..39b9f27d 100644 --- a/regamedll/dlls/subs.cpp +++ b/regamedll/dlls/subs.cpp @@ -108,7 +108,7 @@ void CBaseDelay::KeyValue(KeyValueData *pkvd) // // Search for (string)targetname in all entities that // match (string)self.target and call their .use function (if they have one) -void CBaseEntity::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value) +NOINLINE void CBaseEntity::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value) { // fire targets if (!FStringNull(pev->target)) @@ -367,7 +367,7 @@ void CBaseToggle::AngularMove(Vector vecDestAngle, float flSpeed) m_vecFinalAngle = vecDestAngle; // Already there? - if (vecDestAngle == pev->angles) + if (pev->angles == vecDestAngle) { AngularMoveDone(); return;