File diff r8467:0ea88f22d4aa → r8468:1874b30da9a2
src/unmovable_cmd.cpp
Show inline comments
 
@@ -446,12 +446,25 @@ restart:
 
static void ChangeTileOwner_Unmovable(TileIndex tile, PlayerID old_player, PlayerID new_player)
 
{
 
	if (!IsTileOwner(tile, old_player)) return;
 

	
 
	if (IsOwnedLand(tile) && new_player != PLAYER_SPECTATOR) {
 
		SetTileOwner(tile, new_player);
 
	} else if (IsStatueTile(tile)) {
 
		TownID town = GetStatueTownID(tile);
 
		Town *t = GetTown(town);
 
		ClrBit(t->statues, old_player);
 
		if (new_player != PLAYER_SPECTATOR && !HasBit(t->statues, new_player)) {
 
			/* Transfer ownership to the new company */
 
			SetBit(t->statues, new_player);
 
			SetTileOwner(tile, new_player);
 
		} else {
 
			DoClearSquare(tile);
 
		}
 

	
 
		InvalidateWindow(WC_TOWN_AUTHORITY, town);
 
	} else {
 
		DoClearSquare(tile);
 
	}
 
}
 

	
 
static CommandCost TerraformTile_Unmovable(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new)