From 92eda7c21451c8e4bceccfba41269e2f2f9702be Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 6 Oct 2004 18:43:26 +0000 Subject: [PATCH] *** empty log message *** --- dlls/csx/source/rank.cpp | 23 ++++++++++------------- dlls/dod2/dodx/NRank.cpp | 18 +++++++++--------- dlls/tfc/tfcx/NRank.cpp | 20 ++++++++++---------- dlls/ts/tsx/NRank.cpp | 20 ++++++++++---------- 4 files changed, 39 insertions(+), 42 deletions(-) diff --git a/dlls/csx/source/rank.cpp b/dlls/csx/source/rank.cpp index 50524048..1db48680 100755 --- a/dlls/csx/source/rank.cpp +++ b/dlls/csx/source/rank.cpp @@ -7,7 +7,7 @@ static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int attacker = params[2]; CHECK_PLAYERRANGE(attacker); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); @@ -34,7 +34,7 @@ static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param * static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int victim = params[2]; CHECK_PLAYERRANGE(victim); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); @@ -61,7 +61,7 @@ static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param * static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end) { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int weapon = params[2]; if (weapon<0||weapon>=MAX_WEAPONS+MAX_CWEAPONS){ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon); @@ -89,10 +89,7 @@ static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */ { int index = params[1]; - if (index<1||index>gpGlobals->maxClients){ - MF_RaiseAmxError(amx,AMX_ERR_NATIVE); - return 0; - } + CHECK_PLAYERRANGE(index); int weapon = params[2]; if (weapon<0||weapon>=MAX_WEAPONS+MAX_CWEAPONS){ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon); @@ -128,7 +125,7 @@ static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if (pPlayer->rank){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); @@ -150,7 +147,7 @@ static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param * static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if ( pPlayer->rank ){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); @@ -176,7 +173,7 @@ static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */ static cell AMX_NATIVE_CALL get_user_stats2(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if ( pPlayer->rank ){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); @@ -275,10 +272,10 @@ static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,v } int att = params[2]; - CHECK_PLAYER(att); + CHECK_PLAYERRANGE(att); int vic = params[3]; - CHECK_PLAYER(vic); + CHECK_PLAYERRANGE(vic); int dmg = params[4]; if ( dmg<1 ){ @@ -315,7 +312,7 @@ static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,v static cell AMX_NATIVE_CALL custom_wpn_shot(AMX *amx, cell *params){ // player,wid int index = params[2]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int weapon = params[1]; if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){ diff --git a/dlls/dod2/dodx/NRank.cpp b/dlls/dod2/dodx/NRank.cpp index 4214eb45..1bfc2862 100755 --- a/dlls/dod2/dodx/NRank.cpp +++ b/dlls/dod2/dodx/NRank.cpp @@ -35,7 +35,7 @@ static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int attacker = params[2]; CHECK_PLAYERRANGE(attacker); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); @@ -62,7 +62,7 @@ static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param * static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int victim = params[2]; CHECK_PLAYERRANGE(victim); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); @@ -89,7 +89,7 @@ static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param * static cell AMX_NATIVE_CALL get_user_wlstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end) { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int weapon = params[2]; if (weapon<0||weapon>=DODMAX_WEAPONS){ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon); @@ -118,7 +118,7 @@ static cell AMX_NATIVE_CALL get_user_wlstats(AMX *amx, cell *params) /* 4 param static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end) { int index = params[1]; - CHECK_PLAYER(index) + CHECK_PLAYERRANGE(index) int weapon = params[2]; if (weapon<0||weapon>=DODMAX_WEAPONS){ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon); @@ -147,7 +147,7 @@ static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */ { int index = params[1]; - CHECK_PLAYER(index) + CHECK_PLAYERRANGE(index) int weapon = params[2]; if (weapon<0||weapon>=DODMAX_WEAPONS){ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon); @@ -176,7 +176,7 @@ static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param * static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); pPlayer->restartStats(); return 1; @@ -185,7 +185,7 @@ static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if ( pPlayer->ingame ){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); @@ -210,7 +210,7 @@ static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */ static cell AMX_NATIVE_CALL get_user_lstats(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if (pPlayer->ingame){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); @@ -233,7 +233,7 @@ static cell AMX_NATIVE_CALL get_user_lstats(AMX *amx, cell *params) /* 3 param * static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index) + CHECK_PLAYERRANGE(index) CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if (pPlayer->ingame){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); diff --git a/dlls/tfc/tfcx/NRank.cpp b/dlls/tfc/tfcx/NRank.cpp index b7c8bf1c..bc1cae95 100755 --- a/dlls/tfc/tfcx/NRank.cpp +++ b/dlls/tfc/tfcx/NRank.cpp @@ -36,7 +36,7 @@ static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int attacker = params[2]; CHECK_PLAYERRANGE(attacker); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); @@ -63,7 +63,7 @@ static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param * static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int victim = params[2]; CHECK_PLAYERRANGE(victim); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); @@ -90,7 +90,7 @@ static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param * static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end) { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int weapon = params[2]; if (weapon<0||weapon>=TFCMAX_WEAPONS){ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon); @@ -118,7 +118,7 @@ static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int weapon = params[2]; if (weapon<0||weapon>=TFCMAX_WEAPONS){ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon); @@ -146,7 +146,7 @@ static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param * static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); GET_PLAYER_POINTER_I(index)->restartStats(); return 1; } @@ -154,7 +154,7 @@ static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if ( pPlayer->rank ){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); @@ -178,7 +178,7 @@ static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */ static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if (pPlayer->rank){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); @@ -260,10 +260,10 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg } int att = params[2]; - CHECK_PLAYER(att); + CHECK_PLAYERRANGE(att); int vic = params[3]; - CHECK_PLAYER(vic); + CHECK_PLAYERRANGE(vic); int dmg = params[4]; if ( dmg<1 ){ @@ -300,7 +300,7 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg static cell AMX_NATIVE_CALL cwpn_shot(AMX *amx, cell *params){ // player,wid int index = params[2]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int weapon = params[1]; if ( weapon < TFCMAX_WEAPONS-TFCMAX_CUSTOMWPNS ){ diff --git a/dlls/ts/tsx/NRank.cpp b/dlls/ts/tsx/NRank.cpp index 0a5bb159..62d92100 100755 --- a/dlls/ts/tsx/NRank.cpp +++ b/dlls/ts/tsx/NRank.cpp @@ -36,7 +36,7 @@ static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int attacker = params[2]; CHECK_PLAYERRANGE(attacker); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); @@ -63,7 +63,7 @@ static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param * static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int victim = params[2]; CHECK_PLAYERRANGE(victim); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); @@ -90,7 +90,7 @@ static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param * static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end) { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int weapon = params[2]; if (weapon<0||weapon>=TSMAX_WEAPONS){ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon); @@ -118,7 +118,7 @@ static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int weapon = params[2]; if (weapon<0||weapon>=TSMAX_WEAPONS){ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon); @@ -146,7 +146,7 @@ static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param * static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); GET_PLAYER_POINTER_I(index)->restartStats(); return 1; } @@ -154,7 +154,7 @@ static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if ( pPlayer->rank ){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); @@ -178,7 +178,7 @@ static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */ static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param */ { int index = params[1]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if (pPlayer->rank){ cell *cpStats = MF_GetAmxAddr(amx,params[2]); @@ -260,10 +260,10 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg } int att = params[2]; - CHECK_PLAYER(att); + CHECK_PLAYERRANGE(att); int vic = params[3]; - CHECK_PLAYER(vic); + CHECK_PLAYERRANGE(vic); int dmg = params[4]; if ( dmg<1 ){ @@ -300,7 +300,7 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg static cell AMX_NATIVE_CALL cwpn_shot(AMX *amx, cell *params){ // player,wid int index = params[2]; - CHECK_PLAYER(index); + CHECK_PLAYERRANGE(index); int weapon = params[1]; if ( weapon < TSMAX_WEAPONS-TSMAX_CUSTOMWPNS ){