From 0b9f3d8e8cb0747fb32fcf7ef9fef47861ad7c8c Mon Sep 17 00:00:00 2001 From: Lukasz Wlasinksi Date: Wed, 21 Jul 2004 11:51:18 +0000 Subject: [PATCH] map change crash fixed --- dlls/dod2/dodx/CMisc.cpp | 2 -- dlls/dod2/dodx/CMisc.h | 2 +- dlls/dod2/dodx/moduleconfig.cpp | 9 +++++---- dlls/dod2/dodx/usermsg.cpp | 10 ++++------ 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/dlls/dod2/dodx/CMisc.cpp b/dlls/dod2/dodx/CMisc.cpp index 2a2b3f4e..a2b1b606 100755 --- a/dlls/dod2/dodx/CMisc.cpp +++ b/dlls/dod2/dodx/CMisc.cpp @@ -227,8 +227,6 @@ void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){ void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){ - if ( index == pVictim->index ) return; - if ( ignoreBots(pEdict,pVictim->pEdict) ) return; diff --git a/dlls/dod2/dodx/CMisc.h b/dlls/dod2/dodx/CMisc.h index d5519bb5..bfec1038 100755 --- a/dlls/dod2/dodx/CMisc.h +++ b/dlls/dod2/dodx/CMisc.h @@ -62,7 +62,7 @@ #define MAX_TRACE 6 struct traceVault { - char * szName; + char szName[16]; int iId; int iAction; float fDel; diff --git a/dlls/dod2/dodx/moduleconfig.cpp b/dlls/dod2/dodx/moduleconfig.cpp index 86021576..0dbe4a1b 100755 --- a/dlls/dod2/dodx/moduleconfig.cpp +++ b/dlls/dod2/dodx/moduleconfig.cpp @@ -80,7 +80,7 @@ cvar_t *dodstats_steam; cvar_t init_dodstats_steam = {"dodstats_steam","1"}; struct sUserMsg { - const char* name; + const char *name; int* id; funEventCall func; bool endmsg; @@ -169,6 +169,9 @@ void ServerDeactivate() { g_rank.saveRank( MF_BuildPathname("%s",get_localinfo("dodstats") ) ); + g_damage_info.clear(); + g_death_info.clear(); + // clear custom weapons info for ( i=DODMAX_WEAPONS-DODMAX_CUSTOMWPNS;ipHit&&(ptr->pHit->v.flags& (FL_CLIENT | FL_FAKECLIENT) )&& - e&&(e->v.flags& (FL_CLIENT | FL_FAKECLIENT) )){ + e && (e->v.flags&(FL_CLIENT | FL_FAKECLIENT) )){ GET_PLAYER_POINTER(e)->aiming = ptr->iHitgroup; RETURN_META(MRES_IGNORED); } @@ -373,6 +376,4 @@ void FN_AMXX_Detach() { g_rank.clear(); g_grenades.clear(); g_rank.unloadCalc(); - g_damage_info.clear(); - g_death_info.clear(); } diff --git a/dlls/dod2/dodx/usermsg.cpp b/dlls/dod2/dodx/usermsg.cpp index 40ac8e8b..da57fd2b 100755 --- a/dlls/dod2/dodx/usermsg.cpp +++ b/dlls/dod2/dodx/usermsg.cpp @@ -169,11 +169,9 @@ void Client_Health_End(void* mValue){ g_damage_info.exec( pAttacker->index, mPlayer->index, damage, weapon, aim, TA ); - if ( mPlayer->IsAlive() ) - return; - - pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TA); - g_death_info.exec( pAttacker->index, mPlayer->index, weapon, aim, TA ); - + if ( !mPlayer->IsAlive() ){ + pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TA); + g_death_info.exec( pAttacker->index, mPlayer->index, weapon, aim, TA ); + } }