From a64ebd8e36b6cd13f18163d0a3365f4e80d90805 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 30 Mar 2015 16:34:12 +0200 Subject: Turn maxplayers into a global variable ... and decrease its value from MAXPLAYERS (i.e. 8) to 4 if (gamemode == shareware). It seems that it was hard-coded to this value until some time between the releases of the Demo and the Full version. Arrays are still declared with their full width of 8, though, they are just not iterated over the whole range anymore. This fixes playback of the IWAD demos. --- src/hexen/p_mobj.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/hexen/p_mobj.c') diff --git a/src/hexen/p_mobj.c b/src/hexen/p_mobj.c index 98f81984..b868da8c 100644 --- a/src/hexen/p_mobj.c +++ b/src/hexen/p_mobj.c @@ -1190,7 +1190,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) { mobj->reactiontime = info->reactiontime; } - mobj->lastlook = P_Random() % MAXPLAYERS; + mobj->lastlook = P_Random() % maxplayers; // Set the state, but do not use P_SetMobjState, because action // routines can't be called yet. If the spawnstate has an action @@ -1295,7 +1295,7 @@ void P_SpawnPlayer(mapthing_t * mthing) fixed_t x, y, z; mobj_t *mobj; - if (mthing->type - 1 >= MAXPLAYERS || !playeringame[mthing->type - 1]) + if (mthing->type - 1 >= maxplayers || !playeringame[mthing->type - 1]) { // Not playing return; } @@ -1500,7 +1500,7 @@ void P_SpawnMapThing(mapthing_t * mthing) else if (deathmatch == false) { // Cooperative spawnMask = 0; - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) { if (playeringame[i]) { -- cgit v1.2.3