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;

View File

@ -506,7 +506,7 @@ static cell AMX_NATIVE_CALL objective_set_data(AMX *amx, cell *params){ // index
GET_CP_PD(pent).model_body_neutral = ivalue;
return 1;
case CP_model_body_allies :
GET_CP_PD(pent).model_body_axis = ivalue;
GET_CP_PD(pent).model_body_allies = ivalue;
return 1;
case CP_model_body_axis :
GET_CP_PD(pent).model_body_axis = ivalue;

View File

@ -387,12 +387,12 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params)
pVic->pEdict->v.dmg_inflictor = NULL;
if(pAtt->index != pVic->index)
pAtt->saveHit(pVic , weapon , dmg, aim);
if(!pAtt)
pAtt = pVic;
if(pAtt->index != pVic->index)
pAtt->saveHit(pVic , weapon , dmg, aim);
int TA = 0;
if((pVic->pEdict->v.team == pAtt->pEdict->v.team) && (pVic != pAtt))

View File

@ -1110,9 +1110,9 @@ static cell AMX_NATIVE_CALL set_es(AMX *amx, cell *params)
es->vuser3.z = amx_ctof(ptr[2]);
return 1;
case ES_vUser4:
es->vuser3.x = amx_ctof(ptr[0]);
es->vuser3.y = amx_ctof(ptr[1]);
es->vuser3.z = amx_ctof(ptr[2]);
es->vuser4.x = amx_ctof(ptr[0]);
es->vuser4.y = amx_ctof(ptr[1]);
es->vuser4.z = amx_ctof(ptr[2]);
return 1;
}

View File

@ -262,10 +262,10 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg
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->pEdict->v.team == pAtt->pEdict->v.team ) && ( pVic != pAtt) )
TA = 1;

View File

@ -47,7 +47,7 @@ bool isModuleActive(){
bool util_strncmp( const char *sz1, const char *sz2, int size){
int i = 0;
while( sz1[i] && i<=size){
while( i<=size && sz1[i] ){
if ( sz1[i] != sz2[i] )
return false;
i++;

View File

@ -295,10 +295,10 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg
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->pEdict->v.team == pAtt->pEdict->v.team ) && ( pVic != pAtt) )
TA = 1;

View File

@ -122,7 +122,8 @@ void Client_TSHealth_End(void* mValue){
weapon = 37; // throwing knife
aim = pAttacker ? pAttacker->aiming : 0;
pAttacker->saveHit( mPlayer , weapon , damage, aim );
if (pAttacker)
pAttacker->saveHit( mPlayer , weapon , damage, aim );
}
}
if ( !pAttacker ) pAttacker = mPlayer;