void MessageHandlerC::HandleMessages()
{
	while(MessageQueue.empty() != true)
	{

		//0: Kill
		//1: Spawn
		//2: Focus


		Message message = MessageQueue.front();
		//the kill command
		if (message.command == 0)
		{
			KillActor(message.ref);
		}
		//An impromptu spawn command I guess
		else if (message.command == 1)
		{
			SpawnActor(message.hexCoords);
		}

		//now get rid of the message
		MessageQueue.pop();
	}
}
Exemple #2
0
void kill_all_molotovs(){
	int i;
	InfMolotov* m;
	for(i=0; i<NUMBER_OF_MOLOTOVS; i++) {
		m = &molotovs[i];
		m->active=GE_FALSE;
		
		if( m->molotov ){
			if(! molotovCurrentWorld ){
				error("No previous world present when clearing molotovs");
			}
			KillActor(molotovCurrentWorld, &(m->molotov));
			m->molotov = 0;
		}

		geVec3d_Clear(&(m->position));
		geVec3d_Clear(&(m->velocity));
		geXForm3d_SetIdentity(&(m->xform));
	}
	molotovCurrentWorld = 0;
	molotovIndex = 0;
}
void kill_all_miniRockets(){
	int i;
	InfMiniRocket* g;
	for(i=0; i<NUMBER_OF_MINIROCKETS; i++) {
		g = &miniRockets[i];
		g->active=GE_FALSE;
		
		if( g->mini_rocket ){
			if(! mini_rocketCurrentWorld ){
				error("No previous world present when clearing miniRockets");
			}
			KillActor(mini_rocketCurrentWorld, &(g->mini_rocket));
			g->mini_rocket = 0;
		}

		geVec3d_Clear(&(g->position));
		geVec3d_Clear(&(g->velocity));
		geXForm3d_SetIdentity(&(g->xform));
	}
	mini_rocketCurrentWorld = 0;
	mini_rocketIndex = 0;
}