diff --git a/src/p_saveg.c b/src/p_saveg.c index 4084d8c13..f2e8dcdb7 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -664,6 +664,7 @@ static void P_NetArchiveWorld(void) diff2 |= SD_TAG; if (ss->nexttag != ss->spawn_nexttag || ss->firsttag != ss->spawn_firsttag) diff3 |= SD_TAGLIST; + if (ss->extra_colormap != ss->spawn_extra_colormap) diff3 |= SD_COLORMAP; @@ -729,6 +730,8 @@ static void P_NetArchiveWorld(void) WRITEINT32(put, ss->firsttag); WRITEINT32(put, ss->nexttag); } + if (diff3 & SD_MIDMAP) + WRITEINT32(put, ss->midmap); if (diff3 & SD_COLORMAP) SaveExtraColormap(put, ss->extra_colormap); diff --git a/src/p_setup.c b/src/p_setup.c index c08c2ac58..5d7fd3179 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1466,6 +1466,7 @@ static void P_LoadRawSideDefs2(void *data) { case 63: // variable colormap via 242 linedef case 606: //SoM: 4/4/2000: Just colormap transfer + case 447: // Change colormap of tagged sectors! -- Monster Iestyn 14/06/18 // SoM: R_CreateColormap will only create a colormap in software mode... // Perhaps we should just call it instead of doing the calculations here. sec->extra_colormap = sec->spawn_extra_colormap = R_CreateColormap(msd->toptexture, msd->midtexture, diff --git a/src/p_spec.c b/src/p_spec.c index 5135676ab..b5e862749 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3250,6 +3250,15 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } break; + case 447: // Change colormap of tagged sectors! + // Basically this special applies a colormap to the tagged sectors, just like 606 (the colormap linedef) + // Except it is activated by linedef executor, not level load + // This could even override existing colormaps I believe + // -- Monster Iestyn 14/06/18 + for (secnum = -1; (secnum = P_FindSectorFromLineTag(line, secnum)) >= 0 ;) + sectors[secnum].midmap = line->frontsector->midmap; + break; + case 448: // Change skybox viewpoint/centerpoint if ((mo && mo->player && P_IsLocalPlayer(mo->player)) || (line->flags & ML_NOCLIMB)) { diff --git a/src/r_defs.h b/src/r_defs.h index 63ca29aa1..1d1d471e5 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -390,6 +390,7 @@ typedef struct sector_s // these are saved for netgames, so do not let Lua touch these! INT32 spawn_nexttag, spawn_firsttag; // the actual nexttag/firsttag values may differ if the sector's tag was changed + INT32 spawn_bottommap, spawn_midmap, spawn_topmap; // offsets sector spawned with (via linedef type 7) fixed_t spawn_flr_xoffs, spawn_flr_yoffs;