Changeset - r1615:6d516e05db7d
[Not reviewed]
master
0 2 0
pasky - 20 years ago 2005-04-02 01:08:01
pasky@openttd.org
(svn r2119) - Fix: [ 1172878 ] Trains "Go to depot" button: click twice skip to next order (patch by Loic GUILLOUX). I also added short explanation of OF_/OFB_ difference to order.h.
2 files changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
order.h
Show inline comments
 
@@ -12,12 +12,14 @@ enum {
 
	OT_LEAVESTATION  = 4,
 
	OT_DUMMY         = 5,
 
	OT_GOTO_WAYPOINT = 6
 
};
 

	
 
/* Order flags -- please use OFB instead OF and use HASBIT/SETBIT/CLEARBIT */
 

	
 
/* Order flag masks - these are for direct bit operations */
 
enum {
 
	//Flags for stations:
 
	OF_UNLOAD         = 0x2,
 
	OF_FULL_LOAD      = 0x4, // Also used when to force an aircraft into a depot
 

	
 
	//Flags for depots:
 
@@ -25,21 +27,22 @@ enum {
 
	OF_HALT_IN_DEPOT  = 0x4,
 

	
 
	//Common flags
 
	OF_NON_STOP  = 0x8
 
};
 

	
 
/* Order flags bits */
 
/* Order flags bits - these are for the *BIT macros */
 
enum {
 
	OFB_UNLOAD         = 1,
 
	OFB_FULL_LOAD      = 2,
 
	OFB_PART_OF_ORDERS = 1,
 
	OFB_HALT_IN_DEPOT  = 2,
 
	OFB_NON_STOP       = 3
 
};
 

	
 

	
 
/* Possible clone options */
 
enum {
 
	CO_SHARE   = 0,
 
	CO_COPY    = 1,
 
	CO_UNSHARE = 2
 
};
train_cmd.c
Show inline comments
 
@@ -1357,13 +1357,13 @@ int32 CmdTrainGotoDepot(int x, int y, ui
 

	
 
	if (v->type != VEH_Train || !CheckOwnership(v->owner))
 
		return CMD_ERROR;
 

	
 
	if (v->current_order.type == OT_GOTO_DEPOT) {
 
		if (flags & DC_EXEC) {
 
			if (HASBIT(v->current_order.flags, OF_PART_OF_ORDERS)) {
 
			if (HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
 
				v->u.rail.days_since_order_progr = 0;
 
				v->cur_order_index++;
 
			}
 

	
 
			v->current_order.type = OT_DUMMY;
 
			v->current_order.flags = 0;
0 comments (0 inline, 0 general)