mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
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:
parent
70502a56e5
commit
5dd83e7768
@ -489,18 +489,16 @@ static void NotchyGen_CreateSurfaceLayer(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void NotchyGen_PlantFlowers(void) {
|
static void NotchyGen_PlantFlowers(void) {
|
||||||
if (Game_Version.Version < VERSION_0023) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int numPatches;
|
int numPatches;
|
||||||
BlockRaw block;
|
BlockRaw block;
|
||||||
int patchX, patchZ;
|
int patchX, patchZ;
|
||||||
int flowerX, flowerY, flowerZ;
|
int flowerX, flowerY, flowerZ;
|
||||||
int i, j, k, index;
|
int i, j, k, index;
|
||||||
|
|
||||||
|
if (Game_Version.Version < VERSION_0023) return;
|
||||||
numPatches = World.Width * World.Length / 3000;
|
numPatches = World.Width * World.Length / 3000;
|
||||||
Gen_CurrentState = "Planting flowers";
|
Gen_CurrentState = "Planting flowers";
|
||||||
|
|
||||||
for (i = 0; i < numPatches; i++) {
|
for (i = 0; i < numPatches; i++) {
|
||||||
Gen_CurrentProgress = (float)i / numPatches;
|
Gen_CurrentProgress = (float)i / numPatches;
|
||||||
|
|
||||||
@ -527,18 +525,16 @@ static void NotchyGen_PlantFlowers(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void NotchyGen_PlantMushrooms(void) {
|
static void NotchyGen_PlantMushrooms(void) {
|
||||||
if (Game_Version.Version < VERSION_0023) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int numPatches, groundHeight;
|
int numPatches, groundHeight;
|
||||||
BlockRaw block;
|
BlockRaw block;
|
||||||
int patchX, patchY, patchZ;
|
int patchX, patchY, patchZ;
|
||||||
int mushX, mushY, mushZ;
|
int mushX, mushY, mushZ;
|
||||||
int i, j, k, index;
|
int i, j, k, index;
|
||||||
|
|
||||||
|
if (Game_Version.Version < VERSION_0023) return;
|
||||||
numPatches = World.Volume / 2000;
|
numPatches = World.Volume / 2000;
|
||||||
Gen_CurrentState = "Planting mushrooms";
|
Gen_CurrentState = "Planting mushrooms";
|
||||||
|
|
||||||
for (i = 0; i < numPatches; i++) {
|
for (i = 0; i < numPatches; i++) {
|
||||||
Gen_CurrentProgress = (float)i / numPatches;
|
Gen_CurrentProgress = (float)i / numPatches;
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@ static void Json_ConsumeString(struct JsonContext* ctx, cc_string* str) {
|
|||||||
if (!ctx->left) break;
|
if (!ctx->left) break;
|
||||||
c = *ctx->cur; JsonContext_Consume(ctx, 1);
|
c = *ctx->cur; JsonContext_Consume(ctx, 1);
|
||||||
if (c == '/' || c == '\\' || c == '"') { String_Append(str, c); continue; }
|
if (c == '/' || c == '\\' || c == '"') { String_Append(str, c); continue; }
|
||||||
|
if (c == 'n') { String_Append(str, '\n'); continue; }
|
||||||
|
|
||||||
/* form of \uYYYY */
|
/* form of \uYYYY */
|
||||||
if (c != 'u' || ctx->left < 4) break;
|
if (c != 'u' || ctx->left < 4) break;
|
||||||
|
@ -745,14 +745,11 @@ static void GLContext_SelectGraphicsMode(struct GraphicsMode* mode) {
|
|||||||
pfd.nVersion = 1;
|
pfd.nVersion = 1;
|
||||||
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER;
|
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER;
|
||||||
/* TODO: PFD_SUPPORT_COMPOSITION FLAG? CHECK IF IT WORKS ON XP */
|
/* TODO: PFD_SUPPORT_COMPOSITION FLAG? CHECK IF IT WORKS ON XP */
|
||||||
|
|
||||||
pfd.cColorBits = mode->R + mode->G + mode->B;
|
pfd.cColorBits = mode->R + mode->G + mode->B;
|
||||||
pfd.cDepthBits = GLCONTEXT_DEFAULT_DEPTH;
|
pfd.cDepthBits = GLCONTEXT_DEFAULT_DEPTH;
|
||||||
|
|
||||||
pfd.iPixelType = PFD_TYPE_RGBA;
|
pfd.iPixelType = PFD_TYPE_RGBA;
|
||||||
pfd.cRedBits = mode->R; // TODO unnecessary??
|
pfd.cAlphaBits = mode->A; /* TODO not needed? test on Intel */
|
||||||
pfd.cGreenBits = mode->G;
|
|
||||||
pfd.cBlueBits = mode->B;
|
|
||||||
pfd.cAlphaBits = mode->A;
|
|
||||||
|
|
||||||
modeIndex = ChoosePixelFormat(win_DC, &pfd);
|
modeIndex = ChoosePixelFormat(win_DC, &pfd);
|
||||||
if (modeIndex == 0) { Logger_Abort("Requested graphics mode not available"); }
|
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.nSize = sizeof(PIXELFORMATDESCRIPTOR);
|
||||||
pfd.nVersion = 1;
|
pfd.nVersion = 1;
|
||||||
|
|
||||||
|
/* TODO DescribePixelFormat might be unnecessary? */
|
||||||
DescribePixelFormat(win_DC, modeIndex, pfd.nSize, &pfd);
|
DescribePixelFormat(win_DC, modeIndex, pfd.nSize, &pfd);
|
||||||
if (!SetPixelFormat(win_DC, modeIndex, &pfd)) {
|
if (!SetPixelFormat(win_DC, modeIndex, &pfd)) {
|
||||||
Logger_Abort2(GetLastError(), "SetPixelFormat failed");
|
Logger_Abort2(GetLastError(), "SetPixelFormat failed");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user