(svn r3305) -Rename: Changed all instances of ottd_ related to the AI to ttai_

This commit is contained in:
truelight 2005-12-14 15:54:23 +00:00
parent f94da63a8d
commit 531073bea0
6 changed files with 33 additions and 33 deletions

20
ai/ai.c
View File

@ -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_error)
}
}
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) {

View File

@ -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 */

View File

@ -395,7 +395,7 @@ int32 CmdInsertOrder(int x, int y, uint32 flags, uint32 p1, uint32 p2)
/* 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;

View File

@ -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, uint32 flags, uint32 p1, uint32 p2)
(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 *v, TileIndex tile, int x, int y)
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;
}

View File

@ -197,8 +197,8 @@ int32 CmdBuildRoadVeh(int x, int y, uint32 flags, uint32 p1, uint32 p2)
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;

View File

@ -1465,8 +1465,8 @@ int32 CmdBuildRoadStop(int x, int y, uint32 flags, uint32 p1, uint32 p2)
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;
}