Changeset - r8866:75ef7edef726
[Not reviewed]
master
0 2 0
rubidium - 16 years ago 2008-04-08 22:41:14
rubidium@openttd.org
(svn r12633) -Fix: could not make a (go-to) depot order.
2 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/order_base.h
Show inline comments
 
@@ -166,13 +166,13 @@ public:
 
	inline OrderUnloadFlags GetUnloadType() const { return (OrderUnloadFlags)GB(this->flags, 0, 2); }
 
	/** Where must we stop? */
 
	OrderNonStopFlags GetNonStopType() const;
 
	/** What caused us going to the depot? */
 
	inline OrderDepotTypeFlags GetDepotOrderType() const { return (OrderDepotTypeFlags)this->flags; }
 
	/** What are we going to do when in the depot. */
 
	inline OrderDepotActionFlags GetDepotActionType() const { return (OrderDepotActionFlags)this->flags; }
 
	inline OrderDepotActionFlags GetDepotActionType() const { return (OrderDepotActionFlags)(this->flags & ODATFB_HALT); }
 

	
 
	/** Set how the consist must be loaded. */
 
	inline void SetLoadType(OrderLoadFlags load_type) { SB(this->flags, 2, 1, !!load_type); }
 
	/** Set how the consist must be unloaded. */
 
	inline void SetUnloadType(OrderUnloadFlags unload_type) { SB(this->flags, 0, 2, unload_type); }
 
	/** Set whether we must stop at stations or not. */
src/order_cmd.cpp
Show inline comments
 
@@ -40,13 +40,13 @@ TileIndex _backup_orders_tile;
 
BackuppedOrders _backup_orders_data;
 

	
 
DEFINE_OLD_POOL_GENERIC(Order, Order);
 

	
 
OrderNonStopFlags Order::GetNonStopType() const
 
{
 
	if (_patches.new_nonstop || this->IsType(OT_GOTO_DEPOT)) {
 
	if (_patches.new_nonstop) {
 
		return (this->flags & 0x08) ? ONSF_NO_STOP_AT_ANY_STATION : ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS;
 
	}
 

	
 
	return (this->flags & 0x08) ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE;
 
}
 

	
 
@@ -313,13 +313,13 @@ CommandCost CmdInsertOrder(TileIndex til
 
					break;
 

	
 
				default: return CMD_ERROR;
 
			}
 

	
 
			/* Non stop not allowed for non-trains. */
 
			if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN) return CMD_ERROR;
 
			// TODO: implement properly once savegame bump is done. if ((new_order.GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) != 0 && v->type != VEH_TRAIN) return CMD_ERROR;
 

	
 
			/* Full load and unload are mutual exclusive. */
 
			if ((new_order.GetLoadType() & OLFB_FULL_LOAD) && (new_order.GetUnloadType() & OUFB_UNLOAD)) return CMD_ERROR;
 

	
 
			/* Filter invalid load/unload types. */
 
			if (new_order.GetLoadType() & ~OLFB_FULL_LOAD) return CMD_ERROR;
 
@@ -360,13 +360,13 @@ CommandCost CmdInsertOrder(TileIndex til
 
						break;
 

	
 
					default: return CMD_ERROR;
 
				}
 
			}
 

	
 
			if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN) return CMD_ERROR;
 
			// TODO: implement properly once savegame bump is done. if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN) return CMD_ERROR;
 
			if (new_order.GetDepotOrderType() & ~ODTFB_PART_OF_ORDERS) return CMD_ERROR;
 
			if (new_order.GetDepotActionType() & ~ODATFB_HALT) return CMD_ERROR;
 
			break;
 
		}
 

	
 
		case OT_GOTO_WAYPOINT: {
 
@@ -378,13 +378,13 @@ CommandCost CmdInsertOrder(TileIndex til
 

	
 
			if (!CheckOwnership(GetTileOwner(wp->xy))) return CMD_ERROR;
 

	
 
			/* Order flags can be any of the following for waypoints:
 
			 * [non-stop]
 
			 * non-stop orders (if any) are only valid for trains */
 
			if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN) return CMD_ERROR;
 
			// TODO: implement properly once savegame bump is done. if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN) return CMD_ERROR;
 

	
 
			break;
 
		}
 

	
 
		default: return CMD_ERROR;
 
	}
0 comments (0 inline, 0 general)