diff --git a/JGE/src/hge/hgeparticle.cpp b/JGE/src/hge/hgeparticle.cpp index 893ec617b..5acc34224 100644 --- a/JGE/src/hge/hgeparticle.cpp +++ b/JGE/src/hge/hgeparticle.cpp @@ -64,8 +64,14 @@ hgeParticleSystem::hgeParticleSystem(const char *filename, JQuad *sprite) //memcpy(&info, psi, sizeof(hgeParticleSystemInfo)); //hge->Resource_Free(psi); - fileSys->ReadFile(&info, sizeof(hgeParticleSystemInfo)); - fileSys->CloseFile(); + // Skip reading the pointer as it may be larger than 4 bytes in the structure + void *dummyPointer; + fileSys->ReadFile(&dummyPointer, 4); + // we're actually trying to read more than the file size now, but it's no problem. + // Note that this fix is only to avoid the largest problems, filling a structure + // by directly reading a file, is really a bad idea ... + fileSys->ReadFile(&(info.nEmission), sizeof(hgeParticleSystemInfo)); + fileSys->CloseFile(); info.sprite=sprite; // info.fGravityMin *= 100;