Loading

Paste #pivfk1xw7

  1. function Road::_Cost(self, path, new_tile, new_direction)
  2. {
  3.     /* path == null means this is the first node of a path, so the cost is 0. */
  4.     if (path == null) return 0;

Paste #pzkccdaam

  1. Severity    Code    Description Project File    Line    Suppression State   Detail Description
  2. Error (active)      more than one operator "*" matches these operands:  openttd d:\OpenTTD\OpenTTD-master\src\script\api\script_airport.cpp 171                 built-in operator "arithmetic * arithmetic"
  3.             function template "OverflowSafeInt<T, T_MAX, T_MIN> operator*<T,T_MAX,T_MIN>(int64 a, OverflowSafeInt<T, T_MAX, T_MIN> b)"
  4.             function template "OverflowSafeInt<T, T_MAX, T_MIN> operator*<T,T_MAX,T_MIN>(int a, OverflowSafeInt<T, T_MAX, T_MIN> b)"
  5.             function template "OverflowSafeInt<T, T_MAX, T_MIN> operator*<T,T_MAX,T_MIN>(uint a, OverflowSafeInt<T, T_MAX, T_MIN> b

Paste #pjjkhttos

  1.     function findRoadTileDepot(tile) {
  2.         if(!AIRoad.IsRoadTile(tile)) {
  3.             return null;
  4.         }

Paste #pdvlasfad

  1. class LuDiAIAfterFix extends AIController {
  2.     MAX_TOWN_VEHICLES = AIGameSettings.GetValue("max_roadveh");
  3.     MIN_DISTANCE = 40;
  4.     MAX_DISTANCE = 115;
  5.     MAX_DISTANCE_INCREASE = 1.2;

Paste #p0lthy3jn

  1.                 local adjacentStationId = checkAdjacentStation(tile, a);
  2.                 local nearest_town;
  3.                 if (adjacentStationId == AIStation.STATION_NEW) {
  4.                     nearest_town = AITile.GetClosestTown(tile);
  5.                     if (nearest_town != town) continue;

Paste #pswaqpejg

  1.     function buildTownStation(town, cargoClass, stationTile, otherTown) {
  2.         local stationId = (stationTile == null) ?  AIStation.STATION_NEW : AIStation.GetStationID(stationTile);
  3.         local vehicleType = (cargoClass == AICargo.CC_MAIL) ? AIRoad.ROADVEHTYPE_TRUCK : AIRoad.ROADVEHTYPE_BUS;
  4. //      local max_spread = AIController.GetSetting("station_spread") && AIGameSettings.GetValue("distant_join_stations");

Paste #p2xv8lx23

  1. function Utils::getValidOffsetTile(tile, offsetX, offsetY) {
  2.     local oldX = AIMap.GetTileX(tile);
  3.     local oldY = AIMap.GetTileY(tile);
  4.    
  5.     local newX = oldX;

Paste #phtxvttpa

  1. function Utils::AreOtherStationsNearby(tile, cargoClass, stationId) {
  2.     local stationType = cargoClass == AICargo.CC_PASSENGERS ? AIStation.STATION_BUS_STOP : AIStation.STATION_TRUCK_STOP;
  3.    
  4.     //check if there are other stations squareSize squares nearby
  5.     local squareSize = AIStation.GetCoverageRadius(stationType);

Paste #petu1y4ig

  1. /* method 1 */     
  2.         for (local tile = 0; tile <= AIMap.GetMapSize(); tile++) {
  3.             if (!AIMap.IsValidTile(tile)) continue;
  4.             local dist = AITile.GetDistanceSquareToTile(tile, airport1_tile);
  5.             local fake = WrightAI.DistanceRealFake(tile, airport1_tile);

Paste #p2gbtm0ut

  1.         local closestTownscopy = AIList();
  2.         for (local town = closestTowns.Begin(); closestTowns.HasNext(); town = closestTowns.Next()) {
  3.             local closest_town = AITile.GetClosestTown(tile);
  4.             if (closestTowns.HasItem(closest_town) {
  5.                 closestTownscopy.AddItem(town);

Paste #pstwsbjfb

  1.         local closestTownscopy = AIList();
  2.         for (local town = closestTowns.Begin(); closestTowns.HasNext(); town = closestTowns.Next()) {
  3.             local closest_town = AITile.GetClosestTown(tile);
  4.             if (closestTowns.HasItem(closest_town) {
  5.                 closestTownscopy.AddItem(town);

Paste #p7wwtf7xn

  1. /* method 1 */     
  2. //      for (local tile = 0; tile <= AIMap.GetMapSize(); tile++) {
  3. //          if (!AIMap.IsValidTile(tile)) continue;
  4. //          local dist = AITile.GetDistanceSquareToTile(tile, airport1_tile);
  5. //          local fake = WrightAI.DistanceRealFake(tile, airport1_tile);

Paste #plclcisfi

  1. /**
  2.  * Find a suitable spot for an airport, walking all towns hoping to find one.
  3.  * When a town is used, it is marked as such and not re-used.
  4.  */
  5. function WrightAI::FindSuitableAirportSpot(airportTypes, airport1_tile, large_aircraft, small_aircraft, helicopter)

Paste #p8fx5g6cz

  1. function WrightAI::GetEngineDaysInTransit(engine_id, fakedist)
  2. {
  3.     local days_in_transit = (fakedist * 256 * 16) / (2 * 74 * AIEngine.GetMaxSpeed(engine_id));
  4.     return days_in_transit;
  5. }

Paste #pkj6pnebd

  1. function WrightAI::GetEngineDaysInTransit(engine_id, fakedist)
  2. {
  3.     local days_in_transit = (fakedist * 256 * 16) / (2 * 74 * AIEngine.GetMaxSpeed(engine_id));
  4.     return days_in_transit;
  5. }