diff --git a/src/g_demo.cpp b/src/g_demo.cpp index 4106c74f6..1f125a46a 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -2251,9 +2251,8 @@ void G_SetDemoCheckpointTiming(player_t *player, tic_t time, UINT8 checkpoint) if (lowest > g->splits[checkpoint]) { lowest = g->splits[checkpoint]; - lowestskin = ((skin_t*)g->mo->skin)->skinnum; - lowestcolor = g->mo->color; - + lowestskin = g->initialskin; + lowestcolor = g->initialcolor; } } @@ -3389,6 +3388,8 @@ void G_AddGhost(savebuffer_t *buffer, const char *defdemoname) UINT8 *p; mapthing_t *mthing; UINT16 count, ghostversion; + UINT16 initialskin = 0; + UINT16 initialcolor = 0; skin_t *ghskin = skins[0]; UINT8 worknumskins; UINT32 num_classes; @@ -3538,7 +3539,11 @@ void G_AddGhost(savebuffer_t *buffer, const char *defdemoname) // Skin i = READUINT8(p); if (i < worknumskins) + { ghskin = skins[skinlist[i].mapping]; + initialskin = skinlist[i].mapping; + } + p++; // lastfakeskin p++; // team @@ -3630,15 +3635,19 @@ void G_AddGhost(savebuffer_t *buffer, const char *defdemoname) gh->mo->skin = gh->oldmo.skin = ghskin; // Set color - gh->mo->color = ((skin_t*)gh->mo->skin)->prefcolor; + gh->mo->color = initialcolor = ((skin_t*)gh->mo->skin)->prefcolor; for (i = 0; i < numskincolors; i++) if (!stricmp(skincolors[i].name,color)) { gh->mo->color = (UINT16)i; + initialcolor = (UINT16)i; break; } gh->oldmo.color = gh->mo->color; + gh->initialskin = initialskin; + gh->initialcolor = initialcolor; + CONS_Printf(M_GetText("Added ghost %s from %s\n"), name, defdemoname); } diff --git a/src/g_demo.h b/src/g_demo.h index 61a6a17fc..62d5577cb 100644 --- a/src/g_demo.h +++ b/src/g_demo.h @@ -201,6 +201,8 @@ struct DemoBufferSizes struct demoghost { UINT8 checksum[16]; UINT8 *buffer, *p, color; + UINT16 initialskin; + UINT16 initialcolor; UINT8 fadein; UINT16 version; UINT8 numskins;