1
0
Fork 0

(svn r6146) -Fix: MSVC doesn't know how to cast to an union.. so fix it via an indirect (and btw the old) way

release/0.5
truelight 2006-08-26 17:31:47 +00:00
parent c6f4f95438
commit 6846e38095
3 changed files with 10 additions and 3 deletions

View File

@ -79,11 +79,14 @@ Depot *AllocateDepot(void)
*/ */
void DestroyDepot(Depot *depot) void DestroyDepot(Depot *depot)
{ {
DestinationID dest;
/* Clear the tile */ /* Clear the tile */
DoClearSquare(depot->xy); DoClearSquare(depot->xy);
/* Clear the depot from all order-lists */ /* Clear the depot from all order-lists */
RemoveOrderFromAllVehicles(OT_GOTO_DEPOT, (DestinationID)depot->index); dest.depot = depot->index;
RemoveOrderFromAllVehicles(OT_GOTO_DEPOT, dest);
/* Delete the depot-window */ /* Delete the depot-window */
DeleteWindowById(WC_VEHICLE_DEPOT, depot->xy); DeleteWindowById(WC_VEHICLE_DEPOT, depot->xy);

View File

@ -2399,6 +2399,7 @@ static uint32 VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
*/ */
static void DeleteStation(Station *st) static void DeleteStation(Station *st)
{ {
DestinationID dest;
StationID index; StationID index;
Vehicle *v; Vehicle *v;
st->xy = 0; st->xy = 0;
@ -2412,7 +2413,8 @@ static void DeleteStation(Station *st)
DeleteWindowById(WC_STATION_VIEW, index); DeleteWindowById(WC_STATION_VIEW, index);
/* Now delete all orders that go to the station */ /* Now delete all orders that go to the station */
RemoveOrderFromAllVehicles(OT_GOTO_STATION, (DestinationID)index); dest.station = index;
RemoveOrderFromAllVehicles(OT_GOTO_STATION, dest);
//And do the same with aircraft that have the station as a hangar-stop //And do the same with aircraft that have the station as a hangar-stop
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {

View File

@ -88,6 +88,7 @@ static void RedrawWaypointSign(const Waypoint* wp)
/* Update all signs */ /* Update all signs */
void UpdateAllWaypointSigns(void) void UpdateAllWaypointSigns(void)
{ {
DestinationID dest;
Waypoint *wp; Waypoint *wp;
FOR_ALL_WAYPOINTS(wp) { FOR_ALL_WAYPOINTS(wp) {
@ -98,7 +99,8 @@ void UpdateAllWaypointSigns(void)
/* Internal handler to delete a waypoint */ /* Internal handler to delete a waypoint */
void DestroyWaypoint(Waypoint *wp) void DestroyWaypoint(Waypoint *wp)
{ {
RemoveOrderFromAllVehicles(OT_GOTO_WAYPOINT, (DestinationID)wp->index); dest.waypoint = wp->index;
RemoveOrderFromAllVehicles(OT_GOTO_WAYPOINT, dest);
if (wp->string != STR_NULL) DeleteName(wp->string); if (wp->string != STR_NULL) DeleteName(wp->string);