Fix some errors (#1020)

Fix some critical errors
This commit is contained in:
Unreal Karaulov
2021-12-03 00:47:57 +03:00
committed by GitHub
parent 5dcda02b65
commit 3cda059669
13 changed files with 37 additions and 23 deletions

View File

@ -229,8 +229,8 @@ void ListboxItemSelected(HWND hDlg) {
// Retrieve complete stats record of this position. Position in listbox should be same as rank in our records!
RankSystem::RankStats* stats = g_rank.findEntryInRankByPos((int)nItem + 1);
if (stats == NULL) {
char msg[] = "Error: Couldn't find the record by position! (nItem = %d)";
sprintf(msg, msg, nItem);
char msg[512];
sprintf(msg, "Error: Couldn't find the record by position! (nItem = %d)", nItem);
MessageBox(hDlg, msg, "Oh fiddlesticks!", MB_OK);
ClearStatsfields(hDlg);
return;

View File

@ -307,10 +307,10 @@ static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,v
CPlayer* pAtt = GET_PLAYER_POINTER_I(att);
CPlayer* pVic = GET_PLAYER_POINTER_I(vic);
if ( !pAtt ) pAtt = pVic;
pVic->pEdict->v.dmg_inflictor = NULL;
pAtt->saveHit( pVic , weapon , dmg, aim );
if ( !pAtt ) pAtt = pVic;
int TA = 0;
if ( (pVic->teamId == pAtt->teamId) && ( pVic != pAtt) )
TA = 1;