Fix compilation with GCC 8.2+ (#617)

* GCC 8.2 support

* Add GCC version check

* -Werror=class-memaccess fix in code

* Use assignment for Stats
This commit is contained in:
Vitaly Karpenko
2019-10-29 22:48:31 +02:00
committed by Vincent Herbet
parent c86813697a
commit 0ccba67006
9 changed files with 25 additions and 25 deletions

View File

@ -95,14 +95,14 @@ void CPlayer::restartStats(bool all)
if ( all )
{
memset(weapons,0,sizeof(weapons));
memset(&round,0,sizeof(round));
memset(static_cast<void *>(&round),0,sizeof(round));
memset(weaponsRnd,0,sizeof(weaponsRnd));
}
memset(weaponsLife,0,sizeof(weaponsLife)); //DEC-Weapon (Round) stats
memset(attackers,0,sizeof(attackers));
memset(victims,0,sizeof(victims));
memset(&life,0,sizeof(life));
life = {};
}
void CPlayer::Init( int pi, edict_t* pe )

View File

@ -172,7 +172,7 @@ void PlayerPreThink_Post(edict_t *pEntity)
if(pPlayer->clearRound && pPlayer->clearRound < gpGlobals->time)
{
pPlayer->clearRound = 0.0f;
memset(&pPlayer->round,0,sizeof(pPlayer->round));
memset(static_cast<void *>(&pPlayer->round),0,sizeof(pPlayer->round));
memset(pPlayer->weaponsRnd,0,sizeof(pPlayer->weaponsRnd));
}