From 750989daacb62013cfce324e7f38dd59e7d9043f Mon Sep 17 00:00:00 2001 From: mittorn Date: Sun, 30 Oct 2016 19:28:15 +0200 Subject: [PATCH] Hack: do not save player followers in coop --- dlls/cbase.cpp | 7 +++++++ dlls/triggers.cpp | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/cbase.cpp b/dlls/cbase.cpp index e9200681..3278460e 100644 --- a/dlls/cbase.cpp +++ b/dlls/cbase.cpp @@ -276,6 +276,13 @@ void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData ) if( pEntity->ObjectCaps() & FCAP_DONT_SAVE ) return; + if( mp_coop_changelevel.value && pent->v.movetype == MOVETYPE_FOLLOW ) + { + // players will not be saved, it's items too + if( ENTINDEX( pent->v.aiment ) > 0 && ENTINDEX( pent->v.aiment ) <= gpGlobals->maxClients ) + return; + } + // These don't use ltime & nextthink as times really, but we'll fudge around it. if( pEntity->pev->movetype == MOVETYPE_PUSH ) { diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index 1b4d0399..7afafff1 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -1576,7 +1576,7 @@ public: if( m_iBanCount >= 2 ) { CoopKickPlayer( pPlayer ); - m_iConfirm--; + m_iConfirm-= 5; return; } m_iConfirm++; MESSAGE_BEGIN( MSG_ALL, 8, NULL ); // svc_print @@ -1609,8 +1609,11 @@ public: votes[imenu-1]++; m_iVoteCount++; - if( votes[1] >= 2 ) // two players vote for ban + if( votes[1] >= 2 ) + { + // two players vote for ban CoopKickPlayer( m_pPlayer ); + } if( m_iVoteCount >= m_iMaxCount ) {