tunnelbridge_cmd.c
changeset 2958 ac0a9673b522
parent 2952 58522ed8f0f1
child 2989 916f9443345f
equal deleted inserted replaced
2957:a4a619da1b15 2958:ac0a9673b522
   661 
   661 
   662 	t = ClosestTownFromTile(tile, (uint)-1); //needed for town rating penalty
   662 	t = ClosestTownFromTile(tile, (uint)-1); //needed for town rating penalty
   663 	// check if you're allowed to remove the tunnel owned by a town
   663 	// check if you're allowed to remove the tunnel owned by a town
   664 	// removal allowal depends on difficulty settings
   664 	// removal allowal depends on difficulty settings
   665 	if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR) {
   665 	if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR) {
   666 		if (!CheckforTownRating(tile, flags, t, TUNNELBRIDGE_REMOVE)) {
   666 		if (!CheckforTownRating(flags, t, TUNNELBRIDGE_REMOVE)) {
   667 			SetDParam(0, t->index);
   667 			SetDParam(0, t->index);
   668 			return_cmd_error(STR_2009_LOCAL_AUTHORITY_REFUSES);
   668 			return_cmd_error(STR_2009_LOCAL_AUTHORITY_REFUSES);
   669 		}
   669 		}
   670 	}
   670 	}
   671 
   671 
   786 
   786 
   787 	t = ClosestTownFromTile(tile, (uint)-1); //needed for town rating penalty
   787 	t = ClosestTownFromTile(tile, (uint)-1); //needed for town rating penalty
   788 	// check if you're allowed to remove the bridge owned by a town.
   788 	// check if you're allowed to remove the bridge owned by a town.
   789 	// removal allowal depends on difficulty settings
   789 	// removal allowal depends on difficulty settings
   790 	if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR) {
   790 	if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR) {
   791 		if (!CheckforTownRating(tile, flags, t, TUNNELBRIDGE_REMOVE))
   791 		if (!CheckforTownRating(flags, t, TUNNELBRIDGE_REMOVE)) return CMD_ERROR;
   792 			return CMD_ERROR;
       
   793 	}
   792 	}
   794 
   793 
   795 	if (flags & DC_EXEC) {
   794 	if (flags & DC_EXEC) {
   796 		byte m5;
   795 		byte m5;
   797 		uint c = tile;
   796 		uint c = tile;