ddnet/src/game/server/entities/flag.cpp
GreYFoXGTi 0b1b949a3c Merge branch 'master' of http://github.com/oy/teeworlds
Conflicts:
	src/game/server/entities/flag.cpp
	src/game/server/entities/flag.h
	src/game/server/gamemodes/ctf.cpp

Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
2010-09-09 05:37:08 +02:00

39 lines
828 B
C++

/*
#include <game/server/gamecontext.h>
#include "flag.h"
CFlag::CFlag(CGameWorld *pGameWorld, int Team)
: CEntity(pGameWorld, NETOBJTYPE_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::Snap(int SnappingClient)
{
CNetObj_Flag *pFlag = (CNetObj_Flag *)Server()->SnapNewItem(NETOBJTYPE_FLAG, m_Team, sizeof(CNetObj_Flag));
pFlag->m_X = (int)m_Pos.x;
pFlag->m_Y = (int)m_Pos.y;
pFlag->m_Team = m_Team;
pFlag->m_CarriedBy = -1;
if(m_AtStand)
pFlag->m_CarriedBy = -2;
else if(m_pCarryingCharacter && m_pCarryingCharacter->GetPlayer())
pFlag->m_CarriedBy = m_pCarryingCharacter->GetPlayer()->GetCID();
}
*/