game/server/openkatana/mode_ctf.c
/*	Spawns the flag for CTF mode!
*/
Spawns the flag for CTF mode!
Spawns the flag for CTF mode!
void CTF_FlagSpawn(ServerEntity_t *eFlag)
{
	if(!cvServerGameMode.iValue == MODE_CAPTURETHEFLAG)
		return;
	eFlag->v.movetype	= MOVETYPE_NONE;
	eFlag->v.items		= ITEM_FLAG;
	eFlag->Physics.iSolid	= SOLID_TRIGGER;
	eFlag->local.iLocalFlags = STATE_FLAG_IDLE;
	switch(eFlag->local.style)
	{
	case TEAM_RED:
		Server_PrecacheSound("ctf/redscore.wav");
		eFlag->v.model		= "models/ctf/flag_red.md2";
		eFlag->v.noise		= "ctf/redflagtaken.wav";
		eFlag->v.netname	= "red flag";
		break;
	case TEAM_BLUE:
		Server_PrecacheSound("ctf/bluescore.wav");
		eFlag->v.model		= "models/ctf/flag_blue.md2";
		eFlag->v.noise		= "ctf/blueflagtaken.wav";
		eFlag->v.netname	= "blue flag";
		break;
	default:
		eFlag->v.model		= "models/ctf/flag_neutral.md2";
		eFlag->v.noise		= "ctf/neutralflagtaken.wav";
		eFlag->v.netname	= "neutral flag";
		break;
	}
	Server_PrecacheModel(eFlag->v.model);
	Server_PrecacheSound(eFlag->v.noise);
	Server_PrecacheSound("ctf/flagtaken.wav");
	Entity_SetModel(eFlag,eFlag->v.model);
	Entity_SetSize(eFlag,-10,-10,0,10,10,65);
	Entity_SetOrigin(eFlag,eFlag->v.origin);
	Math_VectorCopy(eFlag->v.angles,eFlag->local.pos1);
	Math_VectorCopy(eFlag->v.angles,eFlag->local.pos2);
	eFlag->v.bTakeDamage	= false;
	eFlag->v.TouchFunction	= CTF_FlagTouch;
	eFlag->v.think			= CTF_FlagThink;
	eFlag->v.dNextThink		= Server.dTime+0.01;
}
void CTF_FlagSpawn ( ServerEntity_t * eFlag ) { if ( ! cvServerGameMode . iValue == MODE_CAPTURETHEFLAG ) return ; eFlag -> v . movetype = MOVETYPE_NONE ; eFlag -> v . items = ITEM_FLAG ; eFlag -> Physics . iSolid = SOLID_TRIGGER ; eFlag -> local . iLocalFlags = STATE_FLAG_IDLE ; switch ( eFlag -> local . style ) { case TEAM_RED : Server_PrecacheSound ( " " ) ; eFlag -> v . model = " " ; eFlag -> v . noise = " " ; eFlag -> v . netname = " " ; break ; case TEAM_BLUE : Server_PrecacheSound ( " " ) ; eFlag -> v . model = " " ; eFlag -> v . noise = " " ; eFlag -> v . netname = " " ; break ; default : eFlag -> v . model = " " ; eFlag -> v . noise = " " ; eFlag -> v . netname = " " ; break ; } Server_PrecacheModel ( eFlag -> v . model ) ; Server_PrecacheSound ( eFlag -> v . noise ) ; Server_PrecacheSound ( " " ) ; Entity_SetModel ( eFlag , eFlag -> v . model ) ; Entity_SetSize ( eFlag , -10 , -10 , 0 , 10 , 10 , 65 ) ; Entity_SetOrigin ( eFlag , eFlag -> v . origin ) ; Math_VectorCopy ( eFlag -> v . angles , eFlag -> local . pos1 ) ; Math_VectorCopy ( eFlag -> v . angles , eFlag -> local . pos2 ) ; eFlag -> v . bTakeDamage = false ; eFlag -> v . TouchFunction = CTF_FlagTouch ; eFlag -> v . think = CTF_FlagThink ; eFlag -> v . dNextThink = Server . dTime + 0.01 ; }
Spawns the flag for CTF mode!
Spawns the flag for CTF mode!
/*	Once we have support for setting
		our models skin we'll do that here
		instead ;)							*/ // TODO: This is in now, so rewrite the below to use skins instead. // Save our original position.