Properly fix the rtp position calculator

This commit is contained in:
zontreck 2025-03-07 12:23:08 -07:00
parent 1b6586c9e8
commit 2f1ac319de
2 changed files with 10 additions and 8 deletions

View file

@ -28,13 +28,15 @@ public class RTPFactory
while (tries-- > 0)
{
// Generate random X and Z within max RTP distance
bPos.X = (int)vPos.X + rng.Next(0, maxDistance);
bPos.Z = (int)vPos.Z + rng.Next(0, maxDistance);
bPos.Y = 255;
int ixMax = (int)vPos.X + maxDistance;
int ixMin = (int)vPos.X - maxDistance;
int izMax = (int)vPos.Z + maxDistance;
int izMin = (int)vPos.Z - maxDistance;
if (rng.Next(0, 1) == 1) bPos.X = -bPos.X;
if (rng.Next(0, 1) == 1) bPos.Z = -bPos.Z;
// Generate random X and Z within max RTP distance
bPos.X = (int)vPos.X + rng.Next(ixMin, ixMax);
bPos.Z = (int)vPos.Z + rng.Next(izMin, izMax);
bPos.Y = 255;
Block lastAboveLast = null;
Block lastBlock = null;

View file

@ -3,8 +3,8 @@
"modid": "ariasserverutils",
"name": "Aria's Server Utilities",
"authors": ["zontreck"],
"description": "A collection of server utilities\n\nBuild Date: 03-07-2025 @ 12:09 PM MST",
"version": "1.0.6-dev.5",
"description": "A collection of server utilities\n\nBuild Date: 03-07-2025 @ 12:20 PM MST",
"version": "1.0.6-dev.6",
"dependencies": {
"game": ""
}