File diff r4292:340dc5050536 → r4293:cbb984a32af5
economy.c
Show inline comments
 
@@ -1391,13 +1391,13 @@ int LoadUnloadVehicle(Vehicle *v)
 
			case VEH_Road:  t = u->max_speed / 2;           break;
 
			default:        t = u->max_speed;               break;
 
		}
 

	
 
		// if last speed is 0, we treat that as if no vehicle has ever visited the station.
 
		ge->last_speed = min(t, 255);
 
		ge->last_age = _cur_year - v->build_year;
 
		ge->last_age = (_cur_year - BASE_YEAR) - v->build_year;
 

	
 
		// If there's goods waiting at the station, and the vehicle
 
		//  has capacity for it, load it on the vehicle.
 
		count = GB(ge->waiting_acceptance, 0, 12);
 
		if (count != 0 &&
 
				(cap = v->cargo_cap - v->cargo_count) != 0) {
 
@@ -1479,13 +1479,13 @@ int LoadUnloadVehicle(Vehicle *v)
 
	return result;
 
}
 

	
 
void PlayersMonthlyLoop(void)
 
{
 
	PlayersGenStatistics();
 
	if (_patches.inflation && BASE_YEAR + _cur_year < MAX_YEAR)
 
	if (_patches.inflation && _cur_year < MAX_YEAR)
 
		AddInflation();
 
	PlayersPayInterest();
 
	// Reset the _current_player flag
 
	_current_player = OWNER_NONE;
 
	HandleEconomyFluctuations();
 
	SubsidyMonthlyHandler();
 
@@ -1543,13 +1543,13 @@ int32 CmdBuyShareInCompany(TileIndex til
 
	if (p1 >= MAX_PLAYERS || !_patches.allow_shares) return CMD_ERROR;
 

	
 
	SET_EXPENSES_TYPE(EXPENSES_OTHER);
 
	p = GetPlayer(p1);
 

	
 
	/* Protect new companies from hostile takeovers */
 
	if (_cur_year - p->inaugurated_year < 6) return_cmd_error(STR_7080_PROTECTED);
 
	if ((_cur_year - BASE_YEAR) - p->inaugurated_year < 6) return_cmd_error(STR_7080_PROTECTED);
 

	
 
	/* Those lines are here for network-protection (clients can be slow) */
 
	if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 0) return 0;
 

	
 
	/* We can not buy out a real player (temporarily). TODO: well, enable it obviously */
 
	if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 1 && !p->is_ai) return 0;