mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
cd4ba53bae
Conflicts: bam.lua scripts/build.py scripts/make_release.py src/engine/server.h src/game/client/gameclient.cpp src/game/server/gamecontext.cpp src/game/server/gamecontext.h src/game/server/gamecontroller.cpp src/game/server/gamecontroller.h src/game/server/player.cpp src/game/version.h
48 lines
969 B
C++
48 lines
969 B
C++
/* (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 <game/server/gamecontext.h>
|
|
#include "flag.h"
|
|
|
|
CFlag::CFlag(CGameWorld *pGameWorld, int Team)
|
|
: CEntity(pGameWorld, CGameWorld::ENTTYPE_FLAG)
|
|
{
|
|
m_Team = Team;
|
|
m_ProximityRadius = ms_PhysSize;
|
|
m_pCarryingCharacter = NULL;
|
|
m_GrabTick = 0;
|
|
|
|
Reset();
|
|
}
|
|
|
|
void CFlag::Reset()
|
|
{
|
|
m_pCarryingCharacter = NULL;
|
|
m_AtStand = 1;
|
|
m_Pos = m_StandPos;
|
|
m_Vel = vec2(0,0);
|
|
m_GrabTick = 0;
|
|
}
|
|
|
|
void CFlag::TickPaused()
|
|
{
|
|
++m_DropTick;
|
|
if(m_GrabTick)
|
|
++m_GrabTick;
|
|
}
|
|
|
|
void CFlag::Snap(int SnappingClient)
|
|
{
|
|
if(NetworkClipped(SnappingClient))
|
|
return;
|
|
|
|
CNetObj_Flag *pFlag = (CNetObj_Flag *)Server()->SnapNewItem(NETOBJTYPE_FLAG, m_Team, sizeof(CNetObj_Flag));
|
|
if(!pFlag)
|
|
return;
|
|
|
|
pFlag->m_X = (int)m_Pos.x;
|
|
pFlag->m_Y = (int)m_Pos.y;
|
|
pFlag->m_Team = m_Team;
|
|
}
|
|
*/
|