Fix some misprints and mistakes in code, part 2 (#1021)

* Fix compiler warnings about broken syntax

Revert "Fix compiler warnings about broken syntax"

This reverts commit cd0649806feaab064e93a0fbcd1f4488747f9b79.

Unbreak code

* Unbreak code

* Stop breaking code, please

* Small real unused check

* Fix "breaked" code and fix MAX_WEAPONS misprints

* Compiler break in debug mode if passing upper case strings
This commit is contained in:
Unreal Karaulov
2021-12-03 08:24:15 +03:00
committed by GitHub
parent e8909c1583
commit f8ac58c839
15 changed files with 24 additions and 97 deletions

View File

@ -161,10 +161,10 @@ struct CPlayer {
int clip;
};
PlayerWeapon weapons[MAX_WEAPONS];
PlayerWeapon weapons[TFCMAX_WEAPONS];
PlayerWeapon attackers[33];
PlayerWeapon victims[33];
Stats weaponsRnd[MAX_WEAPONS]; // DEC-Weapon (Round) stats
Stats weaponsRnd[TFCMAX_WEAPONS]; // DEC-Weapon (Round) stats
Stats life;
int teamId;

View File

@ -46,7 +46,7 @@ void Client_WeaponList(void* mValue){
break;
case 7:
int iId = *(int*)mValue;
if ( (iId < 0 || iId >= MAX_WEAPONS ) || ( wpnList & (1<<iId) ) )
if ( (iId < 0 || iId >= TFCMAX_WEAPONS ) || ( wpnList & (1<<iId) ) )
break;
wpnList |= (1<<iId);
@ -340,7 +340,7 @@ void Client_AmmoX(void* mValue){
}
//
for(int i = 1; i < MAX_WEAPONS ; ++i)
for(int i = 1; i < TFCMAX_WEAPONS ; ++i)
if (iAmmo == weaponData[i].ammoSlot)
mPlayer->weapons[i].ammo = *(int*)mValue;
}
@ -355,7 +355,7 @@ void Client_AmmoPickup(void* mValue){
break;
case 1:
if (!mPlayer ) break;
for(int i = 1; i < MAX_WEAPONS ; ++i)
for(int i = 1; i < TFCMAX_WEAPONS ; ++i)
if (weaponData[i].ammoSlot == iSlot)
mPlayer->weapons[i].ammo += *(int*)mValue;
}