- cleaned up the merge and consolidated redundant code.

This commit is contained in:
Christoph Oelckers 2016-01-11 15:40:25 +01:00
parent f83b21ff26
commit 0e017f1e2d

View file

@ -66,7 +66,6 @@
// State.
#include "r_state.h"
#include "r_sky.h"
#include "c_console.h"
@ -1111,46 +1110,6 @@ void P_SpawnSkybox(ASkyViewpoint *origin)
}
void P_SpawnHorizon(line_t *line)
{
ASkyViewpoint *origin = Spawn<ASkyViewpoint>(0, 0, 0, NO_REPLACE);
origin->Sector = line->frontsector;
origin->flags7 |= MF7_HANDLENODELAY; // mark as 'special'
if (line->args[1] == 3) origin->flags |= MF_FLOAT; // well, it actually does 'float'... :P
int s;
FSectorTagIterator itr(line->args[0]);
while ((s = itr.Next()) >= 0)
{
SetPortal(&sectors[s], line->args[2], origin, 0);
}
for (int j=0;j<numlines;j++)
{
// Check if this portal needs to be copied to other sectors
// This must be done here to ensure that it gets done only after the portal is set up
if (lines[j].special == Sector_SetPortal &&
lines[j].args[1] == 1 &&
(lines[j].args[2] == line->args[2] || lines[j].args[2] == 3) &&
lines[j].args[3] == line->args[0])
{
if (lines[j].args[0] == 0)
{
SetPortal(lines[j].frontsector, line->args[2], origin, 0);
}
else
{
FSectorTagIterator itr(lines[j].args[0]);
while ((s = itr.Next()) >= 0)
{
SetPortal(&sectors[s], line->args[2], origin, 0);
}
}
}
}
}
//
// P_SetSectorDamage
@ -1503,7 +1462,13 @@ void P_SpawnSpecials (void)
}
else if (lines[i].args[1] == 3 || lines[i].args[1] == 4)
{
P_SpawnHorizon(&lines[i]);
line_t *line = &lines[i];
ASkyViewpoint *origin = Spawn<ASkyViewpoint>(0, 0, 0, NO_REPLACE);
origin->Sector = line->frontsector;
origin->flags7 |= MF7_HANDLENODELAY; // mark as 'special'
if (line->args[1] == 3) origin->flags |= MF_FLOAT; // well, it actually does 'float'... :P
CopyPortal(line->args[0], line->args[2], origin, 0, true);
}
break;