diff options
Diffstat (limited to 'src/hexen')
-rw-r--r-- | src/hexen/p_acs.c | 8 | ||||
-rw-r--r-- | src/hexen/p_mobj.c | 15 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/hexen/p_acs.c b/src/hexen/p_acs.c index 0cd85219..9ab86160 100644 --- a/src/hexen/p_acs.c +++ b/src/hexen/p_acs.c @@ -342,11 +342,13 @@ void P_LoadACScripts(int lump) } } ACStringCount = *buffer++; - ACStrings = (char **) buffer; - for (i = 0; i < ACStringCount; i++) + ACStrings = Z_Malloc(ACStringCount * sizeof(char *), PU_LEVEL, NULL); + + for (i=0; i<ACStringCount; ++i) { - ACStrings[i] += (int) ActionCodeBase; + ACStrings[i] = (char *) ActionCodeBase + buffer[i]; } + memset(MapVars, 0, sizeof(MapVars)); } diff --git a/src/hexen/p_mobj.c b/src/hexen/p_mobj.c index a99b6a65..4accc36b 100644 --- a/src/hexen/p_mobj.c +++ b/src/hexen/p_mobj.c @@ -1446,11 +1446,18 @@ void P_SpawnMapThing(mapthing_t * mthing) // Check for player starts 5 to 8 if (mthing->type >= 9100 && mthing->type <= 9103) { - mthing->type = 5 + mthing->type - 9100; // Translate to 5 - 8 - playerstarts[mthing->arg1][mthing->type - 1] = *mthing; - if (!deathmatch && !mthing->arg1) + mapthing_t *player_start; + int player; + + player = 4 + mthing->type - 9100; + + player_start = &playerstarts[mthing->arg1][player]; + memcpy(player_start, mthing, sizeof(mapthing_t)); + player_start->type = player + 1; + + if (!deathmatch && !player_start->arg1) { - P_SpawnPlayer(mthing); + P_SpawnPlayer(player_start); } return; } |