src/water_cmd.cpp
changeset 6432 8fb778a7f2d7
parent 6317 c73bda71ac16
child 6460 b3017e083031
equal deleted inserted replaced
6431:7f89731a0507 6432:8fb778a7f2d7
   227 	sx = TileX(p1);
   227 	sx = TileX(p1);
   228 	sy = TileY(p1);
   228 	sy = TileY(p1);
   229 
   229 
   230 	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
   230 	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
   231 
   231 
   232 	if (x < sx) intswap(x, sx);
   232 	if (x < sx) Swap(x, sx);
   233 	if (y < sy) intswap(y, sy);
   233 	if (y < sy) Swap(y, sy);
   234 	size_x = (x - sx) + 1;
   234 	size_x = (x - sx) + 1;
   235 	size_y = (y - sy) + 1;
   235 	size_y = (y - sy) + 1;
   236 
   236 
   237 	/* Outside the editor you can only drag canals, and not areas */
   237 	/* Outside the editor you can only drag canals, and not areas */
   238 	if (_game_mode != GM_EDITOR && (sx != x && sy != y)) return CMD_ERROR;
   238 	if (_game_mode != GM_EDITOR && (sx != x && sy != y)) return CMD_ERROR;