Fix a server having \n in its software value not being parsed properly, causing all servers after it in the servers list to not appear

This commit is contained in:
UnknownShadow200 2023-05-20 08:36:53 +10:00
parent 70502a56e5
commit 5dd83e7768
3 changed files with 8 additions and 13 deletions

View File

@ -489,18 +489,16 @@ static void NotchyGen_CreateSurfaceLayer(void) {
}
static void NotchyGen_PlantFlowers(void) {
if (Game_Version.Version < VERSION_0023) {
return;
}
int numPatches;
BlockRaw block;
int patchX, patchZ;
int flowerX, flowerY, flowerZ;
int i, j, k, index;
if (Game_Version.Version < VERSION_0023) return;
numPatches = World.Width * World.Length / 3000;
Gen_CurrentState = "Planting flowers";
for (i = 0; i < numPatches; i++) {
Gen_CurrentProgress = (float)i / numPatches;
@ -527,18 +525,16 @@ static void NotchyGen_PlantFlowers(void) {
}
static void NotchyGen_PlantMushrooms(void) {
if (Game_Version.Version < VERSION_0023) {
return;
}
int numPatches, groundHeight;
BlockRaw block;
int patchX, patchY, patchZ;
int mushX, mushY, mushZ;
int i, j, k, index;
if (Game_Version.Version < VERSION_0023) return;
numPatches = World.Volume / 2000;
Gen_CurrentState = "Planting mushrooms";
for (i = 0; i < numPatches; i++) {
Gen_CurrentProgress = (float)i / numPatches;

View File

@ -89,6 +89,7 @@ static void Json_ConsumeString(struct JsonContext* ctx, cc_string* str) {
if (!ctx->left) break;
c = *ctx->cur; JsonContext_Consume(ctx, 1);
if (c == '/' || c == '\\' || c == '"') { String_Append(str, c); continue; }
if (c == 'n') { String_Append(str, '\n'); continue; }
/* form of \uYYYY */
if (c != 'u' || ctx->left < 4) break;

View File

@ -745,14 +745,11 @@ static void GLContext_SelectGraphicsMode(struct GraphicsMode* mode) {
pfd.nVersion = 1;
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER;
/* TODO: PFD_SUPPORT_COMPOSITION FLAG? CHECK IF IT WORKS ON XP */
pfd.cColorBits = mode->R + mode->G + mode->B;
pfd.cDepthBits = GLCONTEXT_DEFAULT_DEPTH;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cRedBits = mode->R; // TODO unnecessary??
pfd.cGreenBits = mode->G;
pfd.cBlueBits = mode->B;
pfd.cAlphaBits = mode->A;
pfd.cAlphaBits = mode->A; /* TODO not needed? test on Intel */
modeIndex = ChoosePixelFormat(win_DC, &pfd);
if (modeIndex == 0) { Logger_Abort("Requested graphics mode not available"); }
@ -761,6 +758,7 @@ static void GLContext_SelectGraphicsMode(struct GraphicsMode* mode) {
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
pfd.nVersion = 1;
/* TODO DescribePixelFormat might be unnecessary? */
DescribePixelFormat(win_DC, modeIndex, pfd.nSize, &pfd);
if (!SetPixelFormat(win_DC, modeIndex, &pfd)) {
Logger_Abort2(GetLastError(), "SetPixelFormat failed");