Skip to content

Commit

Permalink
Reduce memory usage of CPlayerData with bit-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kurta9999 committed Nov 11, 2014
1 parent 7849779 commit 043a7f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/CPlayerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ class CPlayerData
} stObj[MAX_OBJECTS];

WORD wPlayerID;
bool bObjectsRemoved;

float fGravity;
BYTE byteWeather;
bool bWidescreen;
float fBounds[4];

BYTE byteTeam;
Expand All @@ -102,12 +101,14 @@ class CPlayerData
PickupMap PlayerPickups;
std::bitset<MAX_PICKUPS> bPlayerPickup;

bool bUpdateScoresPingsDisabled;
bool bFakePingToggle;
DWORD dwFakePingValue;

bool bAFKState;
bool bEverUpdated;
DWORD dwLastUpdateTick;

bool bObjectsRemoved : 1;
bool bWidescreen : 1;
bool bUpdateScoresPingsDisabled : 1;
bool bFakePingToggle : 1;
bool bAFKState : 1;
bool bEverUpdated : 1;
};
#endif
2 changes: 1 addition & 1 deletion src/Scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ static cell AMX_NATIVE_CALL Natives::GetActiveTimers(AMX *amx, cell *params)
return pNetGame->pScriptTimers->m_dwTimerCount;
}

// native SendInvalidPlayerSync(playerid) - raksamp versions will crash
// native SendInvalidPlayerSync(playerid); - raksamp versions will crash
static cell AMX_NATIVE_CALL Natives::SendInvalidPlayerSync(AMX *amx, cell *params)
{
// If unknown server version
Expand Down

0 comments on commit 043a7f5

Please sign in to comment.