Fix C client decoding .fcm maps incorrectly

This commit is contained in:
UnknownShadow200 2018-07-22 21:07:03 +10:00
parent 9380fb71db
commit 174e429f3a
3 changed files with 4 additions and 1 deletions

View File

@ -463,7 +463,9 @@ ReturnCode Bitmap_DecodePng(struct Bitmap* bmp, struct Stream* stream) {
if (transparentCol <= PNG_RGB_MASK) {
Png_ComputeTransparency(bmp, transparentCol);
}
if (bmp->Scan0 == NULL) ErrorHandler_Fail("Invalid PNG image");
return 0;
}

View File

@ -154,7 +154,7 @@ void Fcm_Load(struct Stream* stream) {
struct LocalPlayer* p = &LocalPlayer_Instance;
p->Spawn.X = Stream_ReadI32_LE(stream) / 32.0f;
p->Spawn.Y = Stream_ReadI32_LE(stream) / 32.0f;
p->Spawn.Z = Stream_ReadI16_LE(stream) / 32.0f;
p->Spawn.Z = Stream_ReadI32_LE(stream) / 32.0f;
p->SpawnRotY = Math_Packed2Deg(Stream_ReadU8(stream));
p->SpawnHeadX = Math_Packed2Deg(Stream_ReadU8(stream));

View File

@ -166,6 +166,7 @@ ReturnCode Zip_Extract(struct ZipState* state) {
if (sig != ZIP_SIG_LOCALFILEHEADER) return ZIP_ERR_INVALID_LOCAL_DIR;
Zip_ReadLocalFileHeader(state, entry);
}
return 0;
}