summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2007-12-12 14:37:35 +0000
committersmatz <smatz@openttd.org>2007-12-12 14:37:35 +0000
commit5acc147c1cc5322ad1f307f4e1143a17cb8f77b3 (patch)
treedb66fb63672eccb83db1f1e2338cd7b2d56150aa
parente0646af976337e6ed210b0ea920710613f078fca (diff)
downloadopenttd-5acc147c1cc5322ad1f307f4e1143a17cb8f77b3.tar.xz
(svn r11625) -Codechange: add CO_* enum at some places, add includes of order.h too
-rw-r--r--src/ai/trolly/trolly.cpp3
-rw-r--r--src/autoreplace_cmd.cpp2
-rw-r--r--src/order_cmd.cpp2
-rw-r--r--src/order_gui.cpp3
-rw-r--r--src/vehicle.cpp1
5 files changed, 7 insertions, 4 deletions
diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp
index a65371368..3c34a9bac 100644
--- a/src/ai/trolly/trolly.cpp
+++ b/src/ai/trolly/trolly.cpp
@@ -37,6 +37,7 @@
#include "../../vehicle.h"
#include "../../date.h"
#include "../ai.h"
+#include "../../order.h"
// This function is called after StartUp. It is the init of an AI
static void AiNew_State_FirstTime(Player *p)
@@ -1171,7 +1172,7 @@ static void AiNew_State_GiveOrders(Player *p)
assert(p->ainew.state == AI_STATE_GIVE_ORDERS);
if (p->ainew.veh_main_id != INVALID_VEHICLE) {
- AI_DoCommand(0, p->ainew.veh_id + (p->ainew.veh_main_id << 16), 0, DC_EXEC, CMD_CLONE_ORDER);
+ AI_DoCommand(0, p->ainew.veh_id + (p->ainew.veh_main_id << 16), CO_SHARE, DC_EXEC, CMD_CLONE_ORDER);
p->ainew.state = AI_STATE_START_VEHICLE;
return;
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 60f7b826e..d87468f16 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -18,7 +18,7 @@
#include "cargotype.h"
#include "group.h"
#include "strings.h"
-
+#include "order.h"
/*
* move the cargo from one engine to another if possible
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 7e1256727..644b24952 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -983,7 +983,7 @@ void RestoreVehicleOrders(const Vehicle *v, const BackuppedOrders *bak)
/* If we had shared orders, recover that */
if (bak->clone != INVALID_VEHICLE) {
- DoCommandP(0, v->index | (bak->clone << 16), 0, NULL, CMD_CLONE_ORDER);
+ DoCommandP(0, v->index | (bak->clone << 16), CO_SHARE, NULL, CMD_CLONE_ORDER);
} else {
/* CMD_NO_TEST_IF_IN_NETWORK is used here, because CMD_INSERT_ORDER checks if the
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 356782a39..efb29fb9f 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -27,6 +27,7 @@
#include "vehicle_gui.h"
#include "timetable.h"
#include "cargotype.h"
+#include "order.h"
enum OrderWindowWidgets {
ORDER_WIDGET_CLOSEBOX = 0,
@@ -364,7 +365,7 @@ static bool HandleOrderVehClick(const Vehicle *v, const Vehicle *u, Window *w)
// obviously if you press CTRL on a non-empty orders vehicle you know what you are doing
if (v->num_orders != 0 && _ctrl_pressed == 0) return false;
- if (DoCommandP(v->tile, v->index | (u->index << 16), _ctrl_pressed ? 0 : 1, NULL,
+ if (DoCommandP(v->tile, v->index | (u->index << 16), _ctrl_pressed ? CO_SHARE : CO_COPY, NULL,
_ctrl_pressed ? CMD_CLONE_ORDER | CMD_MSG(STR_CANT_SHARE_ORDER_LIST) : CMD_CLONE_ORDER | CMD_MSG(STR_CANT_COPY_ORDER_LIST))) {
WP(w,order_d).sel = -1;
ResetObjectToPlace();
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 802eca17f..70e4fbe19 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -44,6 +44,7 @@
#include "group.h"
#include "economy.h"
#include "strings.h"
+#include "order.h"
#define INVALID_COORD (0x7fffffff)
#define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))