RDR-Classes/rage/atPlayerBits.hpp
maybegreat48 0132075d1c
Netsync stuff (#5)
* feat(metric): add rlMetric

* fix(metric): serializer fix

* feat(tls): add tlsContext

* feat(fwEntity): add entity classes

* fix: add import

* fix(vector): constexpr ctors

* feat(ped): add CPed

* feat(sync): add sync nodes

* feat(netsync): add netSyncDataNode::IsActive

* feat(netsync): first node

* fix: make GetData accessible

* fix: make netSyncDataNode an abstract class

* fix(netsync): the compiler is too smart for its own good

* feat(netsync): add CObjectCreationData

* feat(netsync): add CPlayerAppearanceData

* feat(netsync): CVehicleCreationData

* feat(netsync): add CPickupCreationData

* feat(netsync): add CPhysicalAttachData

* feat(netsync): add CVehicleProximityMigrationData

* feat(netsync): add CPedTaskTreeData

* feat(network): add CScriptedGameEvent

---------
2023-10-09 15:01:36 +02:00

31 lines
554 B
C++

#pragma once
#pragma pack(push, 8)
namespace rage
{
class atPlayerBits
{
constexpr static int MAX_PLAYERS = 32;
int m_PlayerBits[MAX_PLAYERS / 32];
public:
bool IsSet(int id)
{
return _bittest((const long*)&m_PlayerBits[id / 32], id % 32);
}
void Set(int id)
{
m_PlayerBits[id / 32] |= (1 << (id % 32));
}
void Clear(int id)
{
m_PlayerBits[id / 32] &= ~(1 << (id % 32));
}
// TODO: bit count, CNetGamePlayer...
};
static_assert(sizeof(rage::atPlayerBits) == 4);
}
#pragma pack(pop)