diff --git a/dlls/func/CBaseDoor.cpp b/dlls/func/CBaseDoor.cpp index c9b643cb..ef70d89f 100644 --- a/dlls/func/CBaseDoor.cpp +++ b/dlls/func/CBaseDoor.cpp @@ -306,6 +306,13 @@ void CBaseDoor::Spawn() m_vecPosition2 = m_vecPosition1 + (pev->movedir * (fabs(pev->movedir.x * (pev->size.x - 2)) + fabs(pev->movedir.y * (pev->size.y - 2)) + fabs(pev->movedir.z * (pev->size.z - 2)) - m_flLip)); ASSERTSZ(m_vecPosition1 != m_vecPosition2, "door start/end positions are equal\n"); + if (FBitSet(pev->spawnflags, SF_DOOR_START_OPEN)) + { // swap pos1 and pos2, put door at pos2 + UTIL_SetOrigin(pev, m_vecPosition2); + m_vecPosition2 = m_vecPosition1; + m_vecPosition1 = pev->origin; + } + InitDoorTriggers(); m_toggle_state = TS_AT_BOTTOM; @@ -334,12 +341,7 @@ void CBaseDoor::InitDoorTriggers() { if (m_fireOnStartMode == 2) m_fireOnCloseEndMode = USE_TOGGLE; if (m_fireOnStopMode == 2) m_fireOnCloseEndMode = USE_TOGGLE; - if (FBitSet(pev->spawnflags, SF_DOOR_START_OPEN)) - { // swap pos1 and pos2, put door at pos2 - UTIL_SetOrigin(pev, m_vecPosition2); - m_vecPosition2 = m_vecPosition1; - m_vecPosition1 = pev->origin; - + if (FBitSet(pev->spawnflags, SF_DOOR_START_OPEN)) { SWAP(m_fireOnCloseStart, m_fireOnOpenStart, string_t); SWAP(m_fireOnCloseEnd, m_fireOnOpenEnd, string_t); SWAP(m_fireOnCloseStartMode, m_fireOnOpenStartMode, USE_TYPE); diff --git a/dlls/func/CPushable.cpp b/dlls/func/CPushable.cpp index 0ff277bd..59089e18 100644 --- a/dlls/func/CPushable.cpp +++ b/dlls/func/CPushable.cpp @@ -278,12 +278,13 @@ void CPushable::UpdatePushDir(CBaseEntity* pOther, int push) { m_onMovingPlatform = true; } else { - Vector flatObjectDir = pOther->pev->origin - pev->origin; + Vector flatObjectDir = pOther->Center() - Center(); flatObjectDir.z = 0; Vector flatOtherVel = pOther->pev->velocity; flatOtherVel.z = 0; + float dot = DotProduct(flatObjectDir.Normalize(), flatOtherVel.Normalize()); - if (DotProduct(flatObjectDir, flatOtherVel) > 0) { + if (dot > 0 && toucherVelocity.Length()) { // if toucher is moving in the opposite direction of me, don't get pulled along with it. // this can happen a pushable with lower friction touches one with higher friction factor = 0; diff --git a/dlls/item/CItem.h b/dlls/item/CItem.h index 04f2a7d7..7f2cf7d5 100644 --- a/dlls/item/CItem.h +++ b/dlls/item/CItem.h @@ -32,7 +32,7 @@ class EXPORT CItem : public CBaseAnimating void Materialize(void); virtual void ItemUse(CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value); virtual BOOL MyTouch(CBasePlayer* pPlayer) { return FALSE; }; - BOOL ShouldRespawn(); + virtual BOOL ShouldRespawn(); virtual CBaseEntity* Respawn(void); const char* GetModel(); void SetSize(Vector defaultMins, Vector defaultMaxs); diff --git a/dlls/util/TextMenu.cpp b/dlls/util/TextMenu.cpp index 1252b188..134e4698 100644 --- a/dlls/util/TextMenu.cpp +++ b/dlls/util/TextMenu.cpp @@ -199,7 +199,8 @@ void TextMenu::Open(uint8_t duration, uint8_t page, CBasePlayer* player) { lastPage = page; lastDuration = duration; - int limitPerPage = isPaginated() ? ItemsPerPage() : ItemsPerPage(); + int maxItemsWithoutPagination = MAX_PAGE_OPTIONS - (noexit ? 0 : 1); + int limitPerPage = isPaginated() ? ItemsPerPage() : maxItemsWithoutPagination; int itemOffset = page * ItemsPerPage(); int totalPages = (numOptions+(ItemsPerPage() -1)) / ItemsPerPage(); diff --git a/dlls/weapon/CBasePlayerItem.cpp b/dlls/weapon/CBasePlayerItem.cpp index f228ca9b..f439c4b8 100644 --- a/dlls/weapon/CBasePlayerItem.cpp +++ b/dlls/weapon/CBasePlayerItem.cpp @@ -300,7 +300,7 @@ void CBasePlayerItem::DefaultUse(CBaseEntity* pActivator, CBaseEntity* pCaller, } int CBasePlayerItem::ObjectCaps() { - if (pev->effects == MOVETYPE_FOLLOW || (pev->effects & EF_NODRAW)) { + if (pev->movetype == MOVETYPE_FOLLOW || (pev->effects & EF_NODRAW)) { return CBaseEntity::ObjectCaps(); } else { diff --git a/dlls/weapon/CMedkit.cpp b/dlls/weapon/CMedkit.cpp index 0691d111..eab7b91b 100644 --- a/dlls/weapon/CMedkit.cpp +++ b/dlls/weapon/CMedkit.cpp @@ -231,6 +231,10 @@ void CMedkit::SecondaryAttack() continue; } + if (mon->IsPlayer() && mon->pev->iuser1) { + continue; // don't revive spectators + } + float dist = (mon->pev->origin - m_pPlayer->pev->origin).Length(); if (bestTarget == NULL) {