src/unmovable_cmd.cpp
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 6486 4f8af35b11eb
child 6303 84c215fc8eb8
child 9903 dc85aaa556ae
equal deleted inserted replaced
9894:70d78ac95d6c 9895:7bd07f43b0e3
   150 
   150 
   151 		case UNMOVABLE_OWNED_LAND:
   151 		case UNMOVABLE_OWNED_LAND:
   152 			DrawClearLandTile(ti, 0);
   152 			DrawClearLandTile(ti, 0);
   153 
   153 
   154 			image = SPR_BOUGHT_LAND;
   154 			image = SPR_BOUGHT_LAND;
   155 			if (_display_opt & DO_TRANS_BUILDINGS) {
   155 			pal = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
   156 				SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
       
   157 				pal = PALETTE_TO_TRANSPARENT;
       
   158 			} else {
       
   159 				pal = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
       
   160 			}
       
   161 			AddSortableSpriteToDraw(
   156 			AddSortableSpriteToDraw(
   162 				image, pal,
   157 				image, pal,
   163 				ti->x + TILE_SIZE / 2, ti->y + TILE_SIZE / 2, 1, 1, 10, GetSlopeZ(ti->x + TILE_SIZE / 2, ti->y + TILE_SIZE / 2)
   158 				ti->x + TILE_SIZE / 2, ti->y + TILE_SIZE / 2, 1, 1, 10, GetSlopeZ(ti->x + TILE_SIZE / 2, ti->y + TILE_SIZE / 2)
   164 			);
   159 			);
   165 			DrawBridgeMiddle(ti);
   160 			DrawBridgeMiddle(ti);
   231 
   226 
   232 	// checks if you're allowed to remove unmovable things
   227 	// checks if you're allowed to remove unmovable things
   233 	if (_game_mode != GM_EDITOR && _current_player != OWNER_WATER && ((flags & DC_AUTO || !_cheats.magic_bulldozer.value)) )
   228 	if (_game_mode != GM_EDITOR && _current_player != OWNER_WATER && ((flags & DC_AUTO || !_cheats.magic_bulldozer.value)) )
   234 		return_cmd_error(STR_5800_OBJECT_IN_THE_WAY);
   229 		return_cmd_error(STR_5800_OBJECT_IN_THE_WAY);
   235 
   230 
       
   231 	if (IsStatue(tile)) {
       
   232 		TownID town = GetStatueTownID(tile);
       
   233 		CLRBIT(GetTown(town)->statues, _current_player);
       
   234 		InvalidateWindow(WC_TOWN_AUTHORITY, town);
       
   235 	}
       
   236 
   236 	if (flags & DC_EXEC) {
   237 	if (flags & DC_EXEC) {
   237 		DoClearSquare(tile);
   238 		DoClearSquare(tile);
   238 	}
   239 	}
   239 
   240 
   240 	return 0;
   241 	return 0;
   333 	END_TILE_LOOP(tile, 9, 9, tile_s)
   334 	END_TILE_LOOP(tile, 9, 9, tile_s)
   334 
   335 
   335 	return false;
   336 	return false;
   336 }
   337 }
   337 
   338 
   338 void GenerateUnmovables(void)
   339 void GenerateUnmovables()
   339 {
   340 {
   340 	int i, li, j, loop_count;
   341 	int i, li, j, loop_count;
   341 	TileIndex tile;
   342 	TileIndex tile;
   342 	uint h;
   343 	uint h;
   343 	uint maxx;
   344 	uint maxx;