mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 10:52:23 +00:00
Store custom FOF flags directly in back toptexture field at map load instead of re-reading the sidedefs data later on
This commit is contained in:
parent
b333770a3b
commit
abdfe60aa7
2 changed files with 18 additions and 28 deletions
|
@ -1179,6 +1179,20 @@ static void P_LoadSidedefs(UINT8 *data)
|
|||
break;
|
||||
}
|
||||
|
||||
case 259: // Custom FOF
|
||||
if (!isfrontside)
|
||||
{
|
||||
if ((msd->toptexture[0] >= '0' && msd->toptexture[0] <= '9')
|
||||
|| (msd->toptexture[0] >= 'A' && msd->toptexture[0] <= 'F'))
|
||||
sd->toptexture = axtoi(msd->toptexture);
|
||||
else
|
||||
I_Error("Custom FOF (tag %d) needs a value in the linedef's back side upper texture field.", sd->line->tag);
|
||||
|
||||
sd->midtexture = R_TextureNumForName(msd->midtexture);
|
||||
sd->bottomtexture = R_TextureNumForName(msd->bottomtexture);
|
||||
break;
|
||||
}
|
||||
// FALLTHRU
|
||||
default: // normal cases
|
||||
if (msd->toptexture[0] == '#')
|
||||
{
|
||||
|
|
32
src/p_spec.c
32
src/p_spec.c
|
@ -7179,38 +7179,14 @@ void P_SpawnSpecials(boolean fromnetsave)
|
|||
EV_AddLaserThinker(§ors[s], §ors[sec], lines + i, secthinkers);
|
||||
break;
|
||||
|
||||
case 259: // Make-Your-Own FOF!
|
||||
case 259: // Custom FOF
|
||||
if (lines[i].sidenum[1] != 0xffff)
|
||||
{
|
||||
UINT8 *data;
|
||||
UINT16 b;
|
||||
|
||||
if (!virt)
|
||||
virt = vres_GetMap(lastloadedmaplumpnum);
|
||||
|
||||
data = (UINT8*) vres_Find(virt, "SIDEDEFS")->data;
|
||||
|
||||
for (b = 0; b < (INT16)numsides; b++)
|
||||
{
|
||||
register mapsidedef_t *msd = (mapsidedef_t *)data + b;
|
||||
|
||||
if (b == lines[i].sidenum[1])
|
||||
{
|
||||
if ((msd->toptexture[0] >= '0' && msd->toptexture[0] <= '9')
|
||||
|| (msd->toptexture[0] >= 'A' && msd->toptexture[0] <= 'F'))
|
||||
{
|
||||
ffloortype_e FOF_Flags = axtoi(msd->toptexture);
|
||||
|
||||
P_AddFakeFloorsByLine(i, FOF_Flags, secthinkers);
|
||||
break;
|
||||
}
|
||||
else
|
||||
I_Error("Make-Your-Own-FOF (tag %d) needs a value in the linedef's second side upper texture field.", lines[i].tag);
|
||||
}
|
||||
}
|
||||
ffloortype_e fofflags = sides[lines[i].sidenum[1]].toptexture;
|
||||
P_AddFakeFloorsByLine(i, fofflags, secthinkers);
|
||||
}
|
||||
else
|
||||
I_Error("Make-Your-Own FOF (tag %d) found without a 2nd linedef side!", lines[i].tag);
|
||||
I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].tag);
|
||||
break;
|
||||
|
||||
case 300: // Linedef executor (combines with sector special 974/975) and commands
|
||||
|
|
Loading…
Reference in a new issue