summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-08-12 21:29:26 +0000
committerdarkvater <darkvater@openttd.org>2004-08-12 21:29:26 +0000
commit386c8ccfbf45e3a387183de67375988390b9cb7d (patch)
treee94ab8cf6f3d8f20235587a6561ee1cc214b845d
parent52f8e963c1e1b577ece5001ef24653442da8b47d (diff)
downloadopenttd-386c8ccfbf45e3a387183de67375988390b9cb7d.tar.xz
(svn r30) -Fix [1007272] Copy orders between bus/truck possible. You cannot share orders between busses/trucks. You can only copy orders if all the facilities in schedule allow both types to go there (Celestar)
-Fix Dutch in dropdown language box is not in BIGFONT
-rw-r--r--lang/dutch.txt4
-rw-r--r--order_cmd.c23
2 files changed, 25 insertions, 2 deletions
diff --git a/lang/dutch.txt b/lang/dutch.txt
index 1a45aadba..1699dfbc3 100644
--- a/lang/dutch.txt
+++ b/lang/dutch.txt
@@ -1,5 +1,5 @@
-##name Dutch (not complete)
-##ownname Nederlands (niet volledig)
+##name Dutch (not complete)
+##ownname Nederlands (niet volledig)
##id 0x0000
STR_NULL :
diff --git a/order_cmd.c b/order_cmd.c
index eb5c4ccf2..fe45f9a57 100644
--- a/order_cmd.c
+++ b/order_cmd.c
@@ -217,6 +217,12 @@ int32 CmdCloneOrder(int x, int y, uint32 flags, uint32 p1, uint32 p2)
// sanity checks
if (!(src->owner == _current_player && dst->type == src->type && dst != src))
return CMD_ERROR;
+
+ // let's see what happens with road vehicles
+ if (src->type == VEH_Road) {
+ if (src->cargo_type != dst->cargo_type && (src->cargo_type == CT_PASSENGERS || dst->cargo_type == CT_PASSENGERS))
+ return CMD_ERROR;
+ }
if (flags & DC_EXEC) {
DeleteVehicleSchedule(dst);
@@ -237,6 +243,23 @@ int32 CmdCloneOrder(int x, int y, uint32 flags, uint32 p1, uint32 p2)
// sanity checks
if (!(src->owner == _current_player && dst->type == src->type && dst != src))
return CMD_ERROR;
+
+ // let's see what happens with road vehicles
+ if (src->type == VEH_Road) {
+ uint16 ord;
+ int i;
+ Station *st;
+ TileIndex required_dst;
+
+ for (i=0; (ord = src->schedule_ptr[i]) != 0; i++) {
+ if ( ( ord & OT_MASK ) == OT_GOTO_STATION ) {
+ st = DEREF_STATION(ord >> 8);
+ required_dst = (dst->cargo_type == CT_PASSENGERS) ? st->bus_tile : st->lorry_tile;
+ if ( !required_dst )
+ return CMD_ERROR;
+ }
+ }
+ }
// make sure there's orders available
delta = IsScheduleShared(dst) ? src->num_orders + 1 : src->num_orders - dst->num_orders;