Changeset - r2760:b021dc87dfb7
[Not reviewed]
master
0 6 0
truelight - 18 years ago 2005-12-14 15:54:23
truelight@openttd.org
(svn r3305) -Rename: Changed all instances of ottd_ related to the AI to ttai_
6 files changed with 33 insertions and 33 deletions:
0 comments (0 inline, 0 general)
ai/ai.c
Show inline comments
 
@@ -240,7 +240,7 @@ void AI_CommandResult(bool succeeded)
 
	if (_ai_current_uid == 0)
 
		return;
 

	
 
	ai_event(_current_player, succeeded ? ottd_Event_CommandSucceeded : ottd_Event_CommandFailed, _ai_current_tile);
 
	ai_event(_current_player, succeeded ? ttai_Event_CommandSucceeded : ttai_Event_CommandFailed, _ai_current_tile);
 
}
 

	
 
/**
 
@@ -335,34 +335,34 @@ void AI_ShutdownAIControl(bool with_erro
 
	}
 
}
 

	
 
void (*ottd_GetNextAIData)(char **library, char **param);
 
void (*ottd_SetAIParam)(char *param);
 
void (*ttai_GetNextAIData)(char **library, char **param);
 
void (*ttai_SetAIParam)(char *param);
 

	
 
void AI_LoadAIControl(void)
 
{
 
	/* Load module */
 
	_ai.gpmi_mod = gpmi_mod_load("ottd_ai_control_mod", NULL);
 
	_ai.gpmi_mod = gpmi_mod_load("ttai_control_mod", NULL);
 
	if (_ai.gpmi_mod == NULL) {
 
		AI_ShutdownAIControl(true);
 
		return;
 
	}
 

	
 
	/* Load package */
 
	if (gpmi_pkg_load("ottd_ai_control_pkg", 0, NULL, NULL, &_ai.gpmi_pkg)) {
 
	if (gpmi_pkg_load("ttai_control_pkg", 0, NULL, NULL, &_ai.gpmi_pkg)) {
 
		AI_ShutdownAIControl(true);
 
		return;
 
	}
 

	
 
	/* Now link all the functions */
 
	{
 
		ottd_GetNextAIData = gpmi_pkg_resolve(_ai.gpmi_pkg, "ottd_GetNextAIData");
 
		ottd_SetAIParam = gpmi_pkg_resolve(_ai.gpmi_pkg, "ottd_SetAIParam");
 
		ttai_GetNextAIData = gpmi_pkg_resolve(_ai.gpmi_pkg, "ttai_GetNextAIData");
 
		ttai_SetAIParam = gpmi_pkg_resolve(_ai.gpmi_pkg, "ttai_SetAIParam");
 

	
 
		if (ottd_GetNextAIData == NULL || ottd_SetAIParam == NULL)
 
		if (ttai_GetNextAIData == NULL || ttai_SetAIParam == NULL)
 
			AI_ShutdownAIControl(true);
 
	}
 

	
 
	ottd_SetAIParam(_ai.gpmi_param);
 
	ttai_SetAIParam(_ai.gpmi_param);
 
}
 

	
 
/**
 
@@ -391,7 +391,7 @@ void AI_StartNewAI(PlayerID player)
 
		char *library = NULL;
 
		char *params = NULL;
 

	
 
		ottd_GetNextAIData(&library, &params);
 
		ttai_GetNextAIData(&library, &params);
 
		gpmi_error_stack_enable = 1;
 

	
 
		if (library != NULL) {
ai/ai_event.h
Show inline comments
 
@@ -31,7 +31,7 @@
 

	
 
/* To make our life a bit easier; you now only have to define new
 
 *  events here, and automaticly they work in OpenTTD without including
 
 *  the ottd_event package. Just because of some lovely macro-shit ;) */
 
 *  the ttai_event package. Just because of some lovely macro-shit ;) */
 
#ifdef DEF_EVENTS
 
#	define DEF_EVENTS
 
#	define INITIAL_SET = -1
 
@@ -41,24 +41,24 @@
 
#endif /* DEF_EVENTS */
 

	
 
/* ------------ All available events -------------- */
 
DEF_EVENTS int ottd_Event_CommandFailed								INITIAL_SET; // (tile, unique_id)
 
DEF_EVENTS int ottd_Event_CommandSucceeded						INITIAL_SET; // (tile, unique_id)
 
DEF_EVENTS int ttai_Event_CommandFailed								INITIAL_SET; // (tile, unique_id)
 
DEF_EVENTS int ttai_Event_CommandSucceeded						INITIAL_SET; // (tile, unique_id)
 

	
 
DEF_EVENTS int ottd_Event_BuildStation								INITIAL_SET; // (station_index, station_tile)
 
DEF_EVENTS int ottd_Event_BuildRoadStation						INITIAL_SET; // (station_index, station_tile)
 
DEF_EVENTS int ttai_Event_BuildStation								INITIAL_SET; // (station_index, station_tile)
 
DEF_EVENTS int ttai_Event_BuildRoadStation						INITIAL_SET; // (station_index, station_tile)
 

	
 
DEF_EVENTS int ottd_Event_BuildDepot									INITIAL_SET; // (depot_index, depot_tile)
 
DEF_EVENTS int ottd_Event_BuildRoadDepot							INITIAL_SET; // (depot_index, depot_tile)
 
DEF_EVENTS int ttai_Event_BuildDepot									INITIAL_SET; // (depot_index, depot_tile)
 
DEF_EVENTS int ttai_Event_BuildRoadDepot							INITIAL_SET; // (depot_index, depot_tile)
 

	
 
DEF_EVENTS int ottd_Event_BuildVehicle								INITIAL_SET; // (vehicle_index, depot_tile)
 
DEF_EVENTS int ottd_Event_BuildRoadVehicle						INITIAL_SET; // (vehicle_index, depot_tile)
 
DEF_EVENTS int ttai_Event_BuildVehicle								INITIAL_SET; // (vehicle_index, depot_tile)
 
DEF_EVENTS int ttai_Event_BuildRoadVehicle						INITIAL_SET; // (vehicle_index, depot_tile)
 

	
 
DEF_EVENTS int ottd_Event_VehicleEnterDepot						INITIAL_SET; // (vehicle_index, depot_tile)
 
DEF_EVENTS int ottd_Event_RoadVehicleEnterDepot				INITIAL_SET; // (vehicle_index, depot_tile)
 
DEF_EVENTS int ttai_Event_VehicleEnterDepot						INITIAL_SET; // (vehicle_index, depot_tile)
 
DEF_EVENTS int ttai_Event_RoadVehicleEnterDepot				INITIAL_SET; // (vehicle_index, depot_tile)
 

	
 
DEF_EVENTS int ottd_Event_GiveOrder										INITIAL_SET; // (vehicle_index)
 
DEF_EVENTS int ttai_Event_GiveOrder										INITIAL_SET; // (vehicle_index)
 

	
 
DEF_EVENTS int ottd_Event_BuildRoad										INITIAL_SET; // (road_tile, road_pieces)
 
DEF_EVENTS int ttai_Event_BuildRoad										INITIAL_SET; // (road_tile, road_pieces)
 
/* ----------------- End of list ------------------ */
 

	
 
#endif /* AI_EVENT */
order_cmd.c
Show inline comments
 
@@ -395,7 +395,7 @@ int32 CmdInsertOrder(int x, int y, uint3
 
		/* Make sure to rebuild the whole list */
 
		RebuildVehicleLists();
 

	
 
		ai_event(_current_player, ottd_Event_GiveOrder, v->index);
 
		ai_event(_current_player, ttai_Event_GiveOrder, v->index);
 
	}
 

	
 
	return 0;
road_cmd.c
Show inline comments
 
@@ -488,7 +488,7 @@ do_clear:;
 

	
 
		MarkTileDirtyByTile(tile);
 

	
 
		ai_event(_current_player, ottd_Event_BuildRoad, tile, pieces);
 
		ai_event(_current_player, ttai_Event_BuildRoad, tile, pieces);
 
	}
 
	return cost;
 
}
 
@@ -674,8 +674,8 @@ int32 CmdBuildRoadDepot(int x, int y, ui
 
			(p1 | 0x20) /* map5 */
 
		);
 

	
 
		ai_event(_current_player, ottd_Event_BuildDepot, dep->index, tile);
 
		ai_event(_current_player, ottd_Event_BuildRoadDepot, dep->index, tile);
 
		ai_event(_current_player, ttai_Event_BuildDepot, dep->index, tile);
 
		ai_event(_current_player, ttai_Event_BuildRoadDepot, dep->index, tile);
 
	}
 
	return cost + _price.build_road_depot;
 
}
 
@@ -1161,8 +1161,8 @@ static uint32 VehicleEnter_Road(Vehicle 
 
			if (_roadveh_enter_depot_unk0[GB(_m[tile].m5, 0, 2)] == v->u.road.state) {
 
				RoadVehEnterDepot(v);
 

	
 
				ai_event(v->owner, ottd_Event_VehicleEnterDepot, v->index, tile);
 
				ai_event(v->owner, ottd_Event_RoadVehicleEnterDepot, v->index, tile);
 
				ai_event(v->owner, ttai_Event_VehicleEnterDepot, v->index, tile);
 
				ai_event(v->owner, ttai_Event_RoadVehicleEnterDepot, v->index, tile);
 

	
 
				return 4;
 
			}
roadveh_cmd.c
Show inline comments
 
@@ -197,8 +197,8 @@ int32 CmdBuildRoadVeh(int x, int y, uint
 
		if (IsLocalPlayer())
 
			InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Road); // updates the replace Road window
 

	
 
		ai_event(_current_player, ottd_Event_BuildVehicle, v->index, tile);
 
		ai_event(_current_player, ottd_Event_BuildRoadVehicle, v->index, tile);
 
		ai_event(_current_player, ttai_Event_BuildVehicle, v->index, tile);
 
		ai_event(_current_player, ttai_Event_BuildRoadVehicle, v->index, tile);
 
	}
 

	
 
	return cost;
station_cmd.c
Show inline comments
 
@@ -1465,8 +1465,8 @@ int32 CmdBuildRoadStop(int x, int y, uin
 
		UpdateStationAcceptance(st, false);
 
		InvalidateWindow(WC_STATION_LIST, st->owner);
 

	
 
		ai_event(_current_player, ottd_Event_BuildStation, st->index, tile);
 
		ai_event(_current_player, ottd_Event_BuildRoadStation, st->index, tile);
 
		ai_event(_current_player, ttai_Event_BuildStation, st->index, tile);
 
		ai_event(_current_player, ttai_Event_BuildRoadStation, st->index, tile);
 
	}
 
	return cost;
 
}
0 comments (0 inline, 0 general)