From d2fb486e7070febd49e0b857a3f10aefffc2cd45 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Tue, 18 Oct 2005 21:17:12 +0000 Subject: [PATCH] Upcasting args to cell before passing to MF_ExecuteForward --- dlls/csx/source/meta_api.cpp | 19 +++++++++++-------- dlls/csx/source/rank.cpp | 7 +++++-- dlls/csx/source/usermsg.cpp | 6 ++++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/dlls/csx/source/meta_api.cpp b/dlls/csx/source/meta_api.cpp index 7c48ca74..5ebbe8e6 100755 --- a/dlls/csx/source/meta_api.cpp +++ b/dlls/csx/source/meta_api.cpp @@ -117,9 +117,11 @@ void ClientKill(edict_t *pEntity){ if ( !pPlayer->IsAlive()) RETURN_META(MRES_IGNORED); - MF_ExecuteForward( iFDamage,pPlayer->index , pPlayer->index , 0, 0, 0, 0 ); + MF_ExecuteForward( iFDamage,static_cast(pPlayer->index), static_cast(pPlayer->index) , + static_cast(0), static_cast(0), static_cast(0), static_cast(0) ); // he would pPlayer->saveKill(pPlayer,0,0,0); - MF_ExecuteForward( iFDeath,pPlayer->index, pPlayer->index, 0, 0, 0 ); + MF_ExecuteForward( iFDeath,static_cast(pPlayer->index), static_cast(pPlayer->index), + static_cast(0), static_cast(0), static_cast(0) ); RETURN_META(MRES_IGNORED); } @@ -271,19 +273,19 @@ void StartFrame_Post(){ if (g_bombAnnounce){ switch (g_bombAnnounce){ case BOMB_PLANTING: - MF_ExecuteForward( iFBPlanting,g_Planter ); + MF_ExecuteForward( iFBPlanting, static_cast(g_Planter) ); break; case BOMB_PLANTED: - MF_ExecuteForward( iFBPlanted,g_Planter ); + MF_ExecuteForward( iFBPlanted, static_cast(g_Planter) ); break; case BOMB_EXPLODE: - MF_ExecuteForward( iFBExplode,g_Planter,g_Defuser ); + MF_ExecuteForward( iFBExplode, static_cast(g_Planter), static_cast(g_Defuser) ); break; case BOMB_DEFUSING: - MF_ExecuteForward( iFBDefusing,g_Defuser ); + MF_ExecuteForward( iFBDefusing, static_cast(g_Defuser) ); break; case BOMB_DEFUSED: - MF_ExecuteForward( iFBDefused,g_Defuser ); + MF_ExecuteForward( iFBDefused, static_cast(g_Defuser) ); break; } g_bombAnnounce = 0; @@ -313,7 +315,8 @@ void SetModel_Post(edict_t *e, const char *m){ break; } if ( w_id ) - MF_ExecuteForward( iFGrenade, pPlayer->index, ENTINDEX(e) ,w_id ); + MF_ExecuteForward( iFGrenade, static_cast(pPlayer->index), + static_cast(ENTINDEX(e)), static_cast(w_id)); } RETURN_META(MRES_IGNORED); diff --git a/dlls/csx/source/rank.cpp b/dlls/csx/source/rank.cpp index e6462978..f1a5dbe0 100755 --- a/dlls/csx/source/rank.cpp +++ b/dlls/csx/source/rank.cpp @@ -303,13 +303,16 @@ static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,v int TA = 0; if ( (pVic->teamId == pAtt->teamId) && ( pVic != pAtt) ) TA = 1; - MF_ExecuteForward( iFDamage,pAtt->index, pVic->index, dmg, weapon, aim, TA ); + MF_ExecuteForward( iFDamage, static_cast(pAtt->index), + static_cast(pVic->index), static_cast(dmg), static_cast(weapon), + static_cast(aim), static_cast(TA) ); if ( pVic->IsAlive() ) return 1; pAtt->saveKill(pVic,weapon,( aim == 1 ) ? 1:0 ,TA); - MF_ExecuteForward( iFDeath,pAtt->index, pVic->index, weapon, aim, TA ); + MF_ExecuteForward( iFDeath, static_cast(pAtt->index), static_cast(pVic->index), + static_cast(weapon), static_cast(aim), static_cast(TA) ); return 1; } diff --git a/dlls/csx/source/usermsg.cpp b/dlls/csx/source/usermsg.cpp index a8103ffb..d05b0075 100755 --- a/dlls/csx/source/usermsg.cpp +++ b/dlls/csx/source/usermsg.cpp @@ -99,12 +99,14 @@ void Client_Damage_End(void* mValue){ if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) ) TA = 1; - MF_ExecuteForward( iFDamage,pAttacker->index , mPlayer->index , damage, weapon, aim, TA ); + MF_ExecuteForward( iFDamage, static_cast(pAttacker->index) , static_cast(mPlayer->index) , + static_cast(damage), static_cast(weapon), static_cast(aim), static_cast(TA) ); if ( !mPlayer->IsAlive() ){ if ( weapon != CSW_C4 ) pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TA); - MF_ExecuteForward( iFDeath,pAttacker->index, mPlayer->index, weapon, aim, TA ); + MF_ExecuteForward( iFDeath, static_cast(pAttacker->index), static_cast(mPlayer->index), + static_cast(weapon), static_cast(aim), static_cast(TA) ); } }