diff --git a/sys/src/games/doom/doomdata.h b/sys/src/games/doom/doomdata.h index 99a5b9c92..155cb59a5 100644 --- a/sys/src/games/doom/doomdata.h +++ b/sys/src/games/doom/doomdata.h @@ -211,7 +211,6 @@ typedef struct short options; } mapthing_t; - #pragma pack off diff --git a/sys/src/games/doom/f_wipe.c b/sys/src/games/doom/f_wipe.c index b9ed2f614..e2039b1a3 100644 --- a/sys/src/games/doom/f_wipe.c +++ b/sys/src/games/doom/f_wipe.c @@ -184,7 +184,7 @@ wipe_doMelt width/=2; - while (ticks--) + while (ticks-- >= 0) { for (i=0;itype); - mo->spawnpoint = mobj->spawnpoint; + memcpy (&mo->spawnpoint, mthing, sizeof(*mthing)); mo->angle = ANG45 * (mthing->angle/45); if (mthing->options & MTF_AMBUSH) @@ -552,7 +552,7 @@ void P_RemoveMobj (mobj_t* mobj) && (mobj->type != MT_INV) && (mobj->type != MT_INS)) { - itemrespawnque[iquehead] = mobj->spawnpoint; + memcpy (&itemrespawnque[iquehead], &mobj->spawnpoint, sizeof(mobj->spawnpoint)); itemrespawntime[iquehead] = leveltime; iquehead = (iquehead+1)&(ITEMQUESIZE-1); @@ -625,7 +625,7 @@ void P_RespawnSpecials (void) z = ONFLOORZ; mo = P_SpawnMobj (x,y,z, i); - mo->spawnpoint = *mthing; + memcpy (&mo->spawnpoint, mthing, sizeof(*mthing)); mo->angle = ANG45 * (mthing->angle/45); // pull it from the que @@ -728,10 +728,10 @@ void P_SpawnMapThing (mapthing_t* mthing) } // check for players specially - if (mthing->type <= 4) + if (mthing->type <= MAXPLAYERS) { // save spots for respawning in network games - playerstarts[mthing->type-1] = *mthing; + memcpy (&playerstarts[mthing->type-1], mthing, sizeof(*mthing)); if (!deathmatch) P_SpawnPlayer (mthing); @@ -784,7 +784,7 @@ void P_SpawnMapThing (mapthing_t* mthing) z = ONFLOORZ; mobj = P_SpawnMobj (x,y,z, i); - mobj->spawnpoint = *mthing; + memcpy (&mobj->spawnpoint, mthing, sizeof(*mthing)); if (mobj->tics > 0) mobj->tics = 1 + (P_Random () % mobj->tics); diff --git a/sys/src/games/doom/r_data.c b/sys/src/games/doom/r_data.c index ecbba8da8..db6c870b2 100644 --- a/sys/src/games/doom/r_data.c +++ b/sys/src/games/doom/r_data.c @@ -91,6 +91,7 @@ typedef struct mappatch_t patches[1]; } maptexture_t; +#pragma pack off /* A single patch from a texture definition, ** basically a rectangular area within @@ -126,10 +127,6 @@ typedef struct texpatch_t patches[1]; } texture_t; - -#pragma pack off - - int firstflat; int lastflat; int numflats; diff --git a/sys/src/games/doom/r_things.c b/sys/src/games/doom/r_things.c index 75d0a3fbc..ffd0f6582 100644 --- a/sys/src/games/doom/r_things.c +++ b/sys/src/games/doom/r_things.c @@ -173,12 +173,12 @@ void R_InitSpriteDefs (char** namelist) /* char** check; */ int i; int l; - int intname; int frame; int rotation; int start; int end; int patched; + char* name; /* BUG This would work if the namelist was NULL terminated which it is not. @@ -213,13 +213,13 @@ numsprites = NUMSPRITES; memset (sprtemp,-1, sizeof(sprtemp)); maxframe = -1; - intname = *(int *)namelist[i]; + name = namelist[i]; // scan the lumps, // filling in the frames for whatever is found for (l=start+1 ; l