Skip to content

Instantly share code, notes, and snippets.

@Wolfolo
Wolfolo / peter-nrt-block-convert-dost-fix.diff
Created August 6, 2018 17:27
Fix for road convert cost
diff --git a/src/road.h b/src/road.h
index 1fc9b3c..4aa5c95 100644
--- a/src/road.h
+++ b/src/road.h
@@ -227,7 +227,7 @@ static inline Money RoadConvertCost(RoadTypeIdentifier from, RoadTypeIdentifier
/* Get the costs for removing and building anew
* A conversion can never be more costly */
- Money rebuildcost = RoadBuildCost(to) - _price[PR_CLEAR_ROAD];
+ Money rebuildcost = RoadBuildCost(to) + _price[PR_CLEAR_ROAD];
diff --git a/src/road.cpp b/src/road.cpp
index 90a9702..3da1662 100644
--- a/src/road.cpp
+++ b/src/road.cpp
@@ -75,7 +75,7 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
/* Always connective */
connective = true;
} else {
- const RoadBits neighbor_rb = GetAnyRoadBits(neighbor_tile, ROADTYPE_ROAD) | GetAnyRoadBits(neighbor_tile, ROADTYPE_TRAM); // TODO
+ const RoadBits neighbor_rb = GetAnyRoadBits(neighbor_tile, ROADTYPE_ROAD) | GetAnyRoadBits(neighbor_tile, ROADTYPE_TRAM); // TODO: check the entire RoadTypeIdentifier
@Wolfolo
Wolfolo / nrt_roadtypeidentifiers.patch
Last active April 24, 2018 19:44
NRT RoadTypeIdentifiers without changing game functionality
diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp
index 04c9f95..d9483f7 100644
--- a/src/articulated_vehicles.cpp
+++ b/src/articulated_vehicles.cpp
@@ -408,7 +408,7 @@ void AddArticulatedParts(Vehicle *first)
gcache->cached_veh_length = VEHICLE_LENGTH; // Callback is called when the consist is finished
rv->state = RVSB_IN_DEPOT;
- rv->roadtype = front->roadtype;
+ rv->rtid = front->rtid;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using Test3D.Tools;
namespace Test3D.Objects
{
public abstract class BaseCamera
{
diff --git a/src/road.cpp b/src/road.cpp
index 8cb4859..7f1d27b 100644
--- a/src/road.cpp
+++ b/src/road.cpp
@@ -250,12 +250,14 @@ bool RoadTypeIdentifier::UnpackIfValid(uint32 data)
/**
* Returns the available RoadSubTypes for the provided RoadType
+ * If the given company is valid then will be returned a list of the available sub types at the current date, while passing
+ * a deity company will make all the sub types available
@Wolfolo
Wolfolo / Camera.cs
Created April 21, 2017 12:27
3d Camera
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Test3D.Objects