src/ai/ai.cpp
changeset 9659 187142ff9b6c
parent 9652 0405e98d8e96
child 9701 da907123be89
equal deleted inserted replaced
9658:f5c4d3c04b5d 9659:187142ff9b6c
   191 	if (!_networking || _network_server) {
   191 	if (!_networking || _network_server) {
   192 		/* Check if we want to run AIs (server or SP only) */
   192 		/* Check if we want to run AIs (server or SP only) */
   193 		const Player* p;
   193 		const Player* p;
   194 
   194 
   195 		FOR_ALL_PLAYERS(p) {
   195 		FOR_ALL_PLAYERS(p) {
   196 			if (p->is_active && p->is_ai) {
   196 			if (p->is_ai) {
   197 				/* This should always be true, else something went wrong... */
   197 				/* This should always be true, else something went wrong... */
   198 				assert(_ai_player[p->index].active);
   198 				assert(_ai_player[p->index].active);
   199 
   199 
   200 				/* Run the script */
   200 				/* Run the script */
   201 				AI_DequeueCommands(p->index);
   201 				AI_DequeueCommands(p->index);
   247 void AI_Uninitialize()
   247 void AI_Uninitialize()
   248 {
   248 {
   249 	const Player* p;
   249 	const Player* p;
   250 
   250 
   251 	FOR_ALL_PLAYERS(p) {
   251 	FOR_ALL_PLAYERS(p) {
   252 		if (p->is_active && p->is_ai) AI_PlayerDied(p->index);
   252 		if (p->is_ai) AI_PlayerDied(p->index);
   253 	}
   253 	}
   254 }
   254 }