mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
fixed events for 64 players
This commit is contained in:
parent
c0efc8b3ea
commit
2c76f33f93
|
@ -721,7 +721,7 @@ bool CCharacter::TakeDamage(vec2 Force, vec2 Source, int Dmg, int From, int Weap
|
||||||
// do damage Hit sound
|
// do damage Hit sound
|
||||||
if(From >= 0 && From != m_pPlayer->GetCID() && GameServer()->m_apPlayers[From])
|
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++)
|
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) &&
|
if(GameServer()->m_apPlayers[i] && (GameServer()->m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS || GameServer()->m_apPlayers[i]->m_DeadSpecMode) &&
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
/* (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. */
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||||
|
#include <base/system.h>
|
||||||
#include "eventhandler.h"
|
#include "eventhandler.h"
|
||||||
#include "gamecontext.h"
|
#include "gamecontext.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
|
@ -18,7 +19,7 @@ void CEventHandler::SetGameServer(CGameContext *pGameServer)
|
||||||
m_pGameServer = 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)
|
if(m_NumEvents == MAX_EVENTS)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -12,7 +12,7 @@ class CEventHandler
|
||||||
int m_aTypes[MAX_EVENTS]; // TODO: remove some of these arrays
|
int m_aTypes[MAX_EVENTS]; // TODO: remove some of these arrays
|
||||||
int m_aOffsets[MAX_EVENTS];
|
int m_aOffsets[MAX_EVENTS];
|
||||||
int m_aSizes[MAX_EVENTS];
|
int m_aSizes[MAX_EVENTS];
|
||||||
int m_aClientMasks[MAX_EVENTS];
|
int64 m_aClientMasks[MAX_EVENTS];
|
||||||
char m_aData[MAX_DATASIZE];
|
char m_aData[MAX_DATASIZE];
|
||||||
|
|
||||||
class CGameContext *m_pGameServer;
|
class CGameContext *m_pGameServer;
|
||||||
|
@ -24,7 +24,7 @@ public:
|
||||||
void SetGameServer(CGameContext *pGameServer);
|
void SetGameServer(CGameContext *pGameServer);
|
||||||
|
|
||||||
CEventHandler();
|
CEventHandler();
|
||||||
void *Create(int Type, int Size, int Mask = -1);
|
void *Create(int Type, int Size, int64 Mask = -1);
|
||||||
void Clear();
|
void Clear();
|
||||||
void Snap(int SnappingClient);
|
void Snap(int SnappingClient);
|
||||||
};
|
};
|
||||||
|
|
|
@ -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)
|
if (Sound < 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -129,7 +129,7 @@ public:
|
||||||
void CreateHammerHit(vec2 Pos);
|
void CreateHammerHit(vec2 Pos);
|
||||||
void CreatePlayerSpawn(vec2 Pos);
|
void CreatePlayerSpawn(vec2 Pos);
|
||||||
void CreateDeath(vec2 Pos, int Who);
|
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
|
// network
|
||||||
void SendChat(int ChatterClientID, int Mode, int To, const char *pText);
|
void SendChat(int ChatterClientID, int Mode, int To, const char *pText);
|
||||||
|
@ -178,8 +178,8 @@ public:
|
||||||
virtual const char *NetVersion() const;
|
virtual const char *NetVersion() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int CmaskAll() { return -1; }
|
inline int64 CmaskAll() { return -1; }
|
||||||
inline int CmaskOne(int ClientID) { return 1<<ClientID; }
|
inline int64 CmaskOne(int ClientID) { return 1<<ClientID; }
|
||||||
inline int CmaskAllExceptOne(int ClientID) { return 0x7fffffff^CmaskOne(ClientID); }
|
inline int64 CmaskAllExceptOne(int ClientID) { return CmaskAll()^CmaskOne(ClientID); }
|
||||||
inline bool CmaskIsSet(int Mask, int ClientID) { return (Mask&CmaskOne(ClientID)) != 0; }
|
inline bool CmaskIsSet(int64 Mask, int ClientID) { return (Mask&CmaskOne(ClientID)) != 0; }
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue