Changeset - r14877:8260fce9fd4a
[Not reviewed]
master
0 5 0
alberth - 15 years ago 2010-03-20 15:30:57
alberth@openttd.org
(svn r19483) -Codechange: Code layout fixes, and parentheses reduction.
5 files changed with 8 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/autoreplace.cpp
Show inline comments
 
@@ -85,8 +85,7 @@ CommandCost RemoveEngineReplacement(Engi
 
	EngineRenew *er = (EngineRenew *)(*erl);
 
	EngineRenew *prev = NULL;
 

	
 
	while (er)
 
	{
 
	while (er) {
 
		if (er->from == engine && er->group_id == group) {
 
			if (flags & DC_EXEC) {
 
				if (prev == NULL) { // First element
src/misc_cmd.cpp
Show inline comments
 
@@ -53,7 +53,7 @@ CommandCost CmdIncreaseLoan(TileIndex ti
 
			loan = _economy.max_loan - c->current_loan;
 
			break;
 
		case 2: // Take the given amount of loan
 
			if ((((int32)p1 < LOAN_INTERVAL) || c->current_loan + (int32)p1 > _economy.max_loan || (p1 % LOAN_INTERVAL) != 0)) return CMD_ERROR;
 
			if ((int32)p1 < LOAN_INTERVAL || c->current_loan + (int32)p1 > _economy.max_loan || p1 % LOAN_INTERVAL != 0) return CMD_ERROR;
 
			loan = p1;
 
			break;
 
	}
 
@@ -97,7 +97,7 @@ CommandCost CmdDecreaseLoan(TileIndex ti
 
			loan -= loan % LOAN_INTERVAL;
 
			break;
 
		case 2: // Repay the given amount of loan
 
			if ((p1 % LOAN_INTERVAL != 0) || ((int32)p1 < LOAN_INTERVAL)) return CMD_ERROR; // Invalid amount to loan
 
			if (p1 % LOAN_INTERVAL != 0 || (int32)p1 < LOAN_INTERVAL) return CMD_ERROR; // Invalid amount to loan
 
			loan = p1;
 
			break;
 
	}
src/order_cmd.cpp
Show inline comments
 
@@ -872,8 +872,7 @@ CommandCost CmdMoveOrder(TileIndex tile,
 

	
 
	/* Don't make senseless movements */
 
	if (moving_order >= v->GetNumOrders() || target_order >= v->GetNumOrders() ||
 
			moving_order == target_order || v->GetNumOrders() <= 1)
 
		return CMD_ERROR;
 
			moving_order == target_order || v->GetNumOrders() <= 1) return CMD_ERROR;
 

	
 
	Order *moving_one = v->GetOrder(moving_order);
 
	/* Don't move an empty order */
src/rail_cmd.cpp
Show inline comments
 
@@ -727,8 +727,7 @@ static CommandCost ValidateAutoDrag(Trac
 
	if (!IsDiagonalTrackdir(*trackdir)) {
 
		trdx = _trackdelta[*trackdir].x;
 
		trdy = _trackdelta[*trackdir].y;
 
		if (abs(dx) != abs(dy) && abs(dx) + abs(trdy) != abs(dy) + abs(trdx))
 
			return CMD_ERROR;
 
		if (abs(dx) != abs(dy) && abs(dx) + abs(trdy) != abs(dy) + abs(trdx)) return CMD_ERROR;
 
	}
 

	
 
	return CommandCost();
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -87,9 +87,9 @@ int CalcBridgeLenCostFactor(int x)
 

	
 
Foundation GetBridgeFoundation(Slope tileh, Axis axis)
 
{
 
	if ((tileh == SLOPE_FLAT) ||
 
	    (((tileh == SLOPE_NE) || (tileh == SLOPE_SW)) && (axis == AXIS_X)) ||
 
	    (((tileh == SLOPE_NW) || (tileh == SLOPE_SE)) && (axis == AXIS_Y))) return FOUNDATION_NONE;
 
	if (tileh == SLOPE_FLAT ||
 
			((tileh == SLOPE_NE || tileh == SLOPE_SW) && axis == AXIS_X) ||
 
			((tileh == SLOPE_NW || tileh == SLOPE_SE) && axis == AXIS_Y)) return FOUNDATION_NONE;
 

	
 
	return (HasSlopeHighestCorner(tileh) ? InclinedFoundation(axis) : FlatteningFoundation(tileh));
 
}
0 comments (0 inline, 0 general)