From 28614b922fb77149a54da1a87bebfbc98736f296 Mon Sep 17 00:00:00 2001 From: ModMaker101 <119018978+ModMaker101@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:08:36 -0400 Subject: Modernize project codebase (#906) * 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 * Add safety checks and fix a issue with vector going OOR --- Minecraft.World/ImprovedNoise.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Minecraft.World/ImprovedNoise.cpp') diff --git a/Minecraft.World/ImprovedNoise.cpp b/Minecraft.World/ImprovedNoise.cpp index 8be9e385..47f39085 100644 --- a/Minecraft.World/ImprovedNoise.cpp +++ b/Minecraft.World/ImprovedNoise.cpp @@ -46,9 +46,9 @@ double ImprovedNoise::noise(double _x, double _y, double _z) double y = _y + yo; double z = _z + zo; - int xf = (int) x; - int yf = (int) y; - int zf = (int) z; + int xf = static_cast(x); + int yf = static_cast(y); + int zf = static_cast(z); if (x < xf) xf--; if (y < yf) yf--; @@ -125,7 +125,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int for (int xx = 0; xx < xSize; xx++) { double x = _x + (xx) * xs + xo; - int xf = (int) x; + int xf = static_cast(x); if (x < xf) xf--; int X = xf & 255; x -= xf; @@ -134,7 +134,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int for (int zz = 0; zz < zSize; zz++) { double z = _z + (zz) * zs + zo; - int zf = (int) z; + int zf = static_cast(z); if (z < zf) zf--; int Z = zf & 255; z -= zf; @@ -163,7 +163,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int for (int xx = 0; xx < xSize; xx++) { double x = _x + (xx) * xs + xo; - int xf = (int) x; + int xf = static_cast(x); if (x < xf) xf--; int X = xf & 255; x -= xf; @@ -173,7 +173,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int for (int zz = 0; zz < zSize; zz++) { double z = _z + (zz) * zs + zo; - int zf = (int) z; + int zf = static_cast(z); if (z < zf) zf--; int Z = zf & 255; z -= zf; @@ -183,7 +183,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int for (int yy = 0; yy < ySize; yy++) { double y = _y + (yy) * ys + yo; - int yf = (int) y; + int yf = static_cast(y); if (y < yf) yf--; int Y = yf & 255; y -= yf; -- cgit v1.2.3