Project modernization (#630)

* Fixed boats falling and a TP glitch #266

* Replaced every C-style cast with C++ ones

* Replaced every C-style cast with C++ ones

* Fixed boats falling and a TP glitch #266

* Updated NULL to nullptr and fixing some type issues

* Modernized and fixed a few bugs

- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.

* Fixing more conflicts

* Replace int loops with size_t and start work on overrides
This commit is contained in:
ModMaker101
2026-03-07 21:56:03 -05:00
committed by GitHub
parent 1be5faaea7
commit a9be52c41a
1373 changed files with 19903 additions and 19449 deletions

View File

@@ -26,9 +26,9 @@ float FixedBiomeSource::getTemperature(int x, int z)
void FixedBiomeSource::getTemperatureBlock(floatArray& temperatures, int x, int z, int w, int h) const
{
if (temperatures.data == NULL || temperatures.length < w * h)
if (temperatures.data == nullptr || temperatures.length < w * h)
{
if(temperatures.data != NULL) delete [] temperatures.data;
if(temperatures.data != nullptr) delete [] temperatures.data;
temperatures = floatArray(w * h);
}
@@ -52,9 +52,9 @@ void FixedBiomeSource::getTemperatureBlock(doubleArray& temperatures, int x, int
void FixedBiomeSource::getDownfallBlock(floatArray &downfalls, int x, int z, int w, int h) const
{
if (downfalls.data == NULL || downfalls.length < w * h)
if (downfalls.data == nullptr || downfalls.length < w * h)
{
if(downfalls.data != NULL) delete [] downfalls.data;
if(downfalls.data != nullptr) delete [] downfalls.data;
downfalls = floatArray(w * h);
}
Arrays::fill(downfalls, 0, w * h, downfall);
@@ -74,9 +74,9 @@ float FixedBiomeSource::getDownfall(int x, int z) const
void FixedBiomeSource::getDownfallBlock(doubleArray downfalls, int x, int z, int w, int h)
{
if (downfalls.data == NULL || downfalls.length < w * h)
if (downfalls.data == nullptr || downfalls.length < w * h)
{
if(downfalls.data != NULL) delete [] downfalls.data;
if(downfalls.data != nullptr) delete [] downfalls.data;
downfalls = doubleArray(w * h);
}
Arrays::fill(downfalls, 0, w * h, (double) downfall);
@@ -129,7 +129,7 @@ TilePos *FixedBiomeSource::findBiome(int x, int z, int r, Biome *toFind, Random
return new TilePos(x - r + random->nextInt(r * 2 + 1), 0, z - r + random->nextInt(r * 2 + 1));
}
return NULL;
return nullptr;
}
TilePos *FixedBiomeSource::findBiome(int x, int z, int r, vector<Biome *> allowed, Random *random)
@@ -139,7 +139,7 @@ TilePos *FixedBiomeSource::findBiome(int x, int z, int r, vector<Biome *> allowe
return new TilePos(x - r + random->nextInt(r * 2 + 1), 0, z - r + random->nextInt(r * 2 + 1));
}
return NULL;
return nullptr;
}
bool FixedBiomeSource::containsOnly(int x, int z, int r, Biome *allowed)