fixed events for 64 players

This commit is contained in:
oy 2018-12-02 12:43:55 +01:00
parent c0efc8b3ea
commit 2c76f33f93
5 changed files with 11 additions and 10 deletions

View file

@ -721,7 +721,7 @@ bool CCharacter::TakeDamage(vec2 Force, vec2 Source, int Dmg, int From, int Weap
// do damage Hit sound
if(From >= 0 && From != m_pPlayer->GetCID() && GameServer()->m_apPlayers[From])
{
int Mask = CmaskOne(From);
int64 Mask = CmaskOne(From);
for(int i = 0; i < MAX_CLIENTS; i++)
{
if(GameServer()->m_apPlayers[i] && (GameServer()->m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS || GameServer()->m_apPlayers[i]->m_DeadSpecMode) &&

View file

@ -1,5 +1,6 @@
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
/* If you are missing that file, acquire a complete release at teeworlds.com. */
#include <base/system.h>
#include "eventhandler.h"
#include "gamecontext.h"
#include "player.h"
@ -18,7 +19,7 @@ void CEventHandler::SetGameServer(CGameContext *pGameServer)
m_pGameServer = pGameServer;
}
void *CEventHandler::Create(int Type, int Size, int Mask)
void *CEventHandler::Create(int Type, int Size, int64 Mask)
{
if(m_NumEvents == MAX_EVENTS)
return 0;

View file

@ -12,7 +12,7 @@ class CEventHandler
int m_aTypes[MAX_EVENTS]; // TODO: remove some of these arrays
int m_aOffsets[MAX_EVENTS];
int m_aSizes[MAX_EVENTS];
int m_aClientMasks[MAX_EVENTS];
int64 m_aClientMasks[MAX_EVENTS];
char m_aData[MAX_DATASIZE];
class CGameContext *m_pGameServer;
@ -24,7 +24,7 @@ public:
void SetGameServer(CGameContext *pGameServer);
CEventHandler();
void *Create(int Type, int Size, int Mask = -1);
void *Create(int Type, int Size, int64 Mask = -1);
void Clear();
void Snap(int SnappingClient);
};

View file

@ -173,7 +173,7 @@ void CGameContext::CreateDeath(vec2 Pos, int ClientID)
}
}
void CGameContext::CreateSound(vec2 Pos, int Sound, int Mask)
void CGameContext::CreateSound(vec2 Pos, int Sound, int64 Mask)
{
if (Sound < 0)
return;

View file

@ -129,7 +129,7 @@ public:
void CreateHammerHit(vec2 Pos);
void CreatePlayerSpawn(vec2 Pos);
void CreateDeath(vec2 Pos, int Who);
void CreateSound(vec2 Pos, int Sound, int Mask=-1);
void CreateSound(vec2 Pos, int Sound, int64 Mask=-1);
// network
void SendChat(int ChatterClientID, int Mode, int To, const char *pText);
@ -178,8 +178,8 @@ public:
virtual const char *NetVersion() const;
};
inline int CmaskAll() { return -1; }
inline int CmaskOne(int ClientID) { return 1<<ClientID; }
inline int CmaskAllExceptOne(int ClientID) { return 0x7fffffff^CmaskOne(ClientID); }
inline bool CmaskIsSet(int Mask, int ClientID) { return (Mask&CmaskOne(ClientID)) != 0; }
inline int64 CmaskAll() { return -1; }
inline int64 CmaskOne(int ClientID) { return 1<<ClientID; }
inline int64 CmaskAllExceptOne(int ClientID) { return CmaskAll()^CmaskOne(ClientID); }
inline bool CmaskIsSet(int64 Mask, int ClientID) { return (Mask&CmaskOne(ClientID)) != 0; }
#endif