Remove character-specific flags, replace them with net-only/no-net flags
This commit is contained in:
parent
29bf89824f
commit
5cec737985
|
@ -9573,11 +9573,6 @@ static inline int lib_getenum(lua_State *L)
|
||||||
lua_pushinteger(L, ((lua_Integer)1<<i));
|
lua_pushinteger(L, ((lua_Integer)1<<i));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (fastcmp(p, "NETONLY"))
|
|
||||||
{
|
|
||||||
lua_pushinteger(L, (lua_Integer)ML_NETONLY);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (mathlib) return luaL_error(L, "linedef flag '%s' could not be found.\n", word);
|
if (mathlib) return luaL_error(L, "linedef flag '%s' could not be found.\n", word);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,11 +130,9 @@ typedef struct
|
||||||
#define ML_EFFECT4 512
|
#define ML_EFFECT4 512
|
||||||
#define ML_EFFECT5 1024
|
#define ML_EFFECT5 1024
|
||||||
|
|
||||||
// New ones to disable lines for characters
|
#define ML_NETONLY 2048 // Apply effect only in netgames
|
||||||
#define ML_NOSONIC 2048
|
#define ML_NONET 4096 // Apply effect only in single player games
|
||||||
#define ML_NOTAILS 4096
|
#define ML_EFFECT6 8192
|
||||||
#define ML_NOKNUX 8192
|
|
||||||
#define ML_NETONLY 14336 // all of the above
|
|
||||||
|
|
||||||
// Bounce off walls!
|
// Bounce off walls!
|
||||||
#define ML_BOUNCY 16384
|
#define ML_BOUNCY 16384
|
||||||
|
|
|
@ -259,9 +259,9 @@ static void line_SpawnViaLine(const int linenum, const boolean spawnthinker)
|
||||||
boolean backceil = (special == 711 || special == 712 || special == 703);
|
boolean backceil = (special == 711 || special == 712 || special == 703);
|
||||||
|
|
||||||
UINT8 flags = 0; // Slope flags
|
UINT8 flags = 0; // Slope flags
|
||||||
if (line->flags & ML_NOSONIC)
|
if (line->flags & ML_NETONLY)
|
||||||
flags |= SL_NOPHYSICS;
|
flags |= SL_NOPHYSICS;
|
||||||
if (line->flags & ML_NOTAILS)
|
if (line->flags & ML_NONET)
|
||||||
flags |= SL_DYNAMIC;
|
flags |= SL_DYNAMIC;
|
||||||
|
|
||||||
if(!frontfloor && !backfloor && !frontceil && !backceil)
|
if(!frontfloor && !backfloor && !frontceil && !backceil)
|
||||||
|
@ -468,9 +468,9 @@ static void line_SpawnViaVertexes(const int linenum, const boolean spawnthinker)
|
||||||
UINT16 tag1, tag2, tag3;
|
UINT16 tag1, tag2, tag3;
|
||||||
|
|
||||||
UINT8 flags = 0;
|
UINT8 flags = 0;
|
||||||
if (line->flags & ML_NOSONIC)
|
if (line->flags & ML_NETONLY)
|
||||||
flags |= SL_NOPHYSICS;
|
flags |= SL_NOPHYSICS;
|
||||||
if (line->flags & ML_NOTAILS)
|
if (line->flags & ML_NONET)
|
||||||
flags |= SL_DYNAMIC;
|
flags |= SL_DYNAMIC;
|
||||||
|
|
||||||
switch(line->special)
|
switch(line->special)
|
||||||
|
@ -494,7 +494,7 @@ static void line_SpawnViaVertexes(const int linenum, const boolean spawnthinker)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line->flags & ML_NOKNUX)
|
if (line->flags & ML_EFFECT6)
|
||||||
{
|
{
|
||||||
tag1 = line->tag;
|
tag1 = line->tag;
|
||||||
tag2 = side->textureoffset >> FRACBITS;
|
tag2 = side->textureoffset >> FRACBITS;
|
||||||
|
|
36
src/p_spec.c
36
src/p_spec.c
|
@ -6322,7 +6322,7 @@ void P_InitSpecials(void)
|
||||||
|
|
||||||
static void P_ApplyFlatAlignment(line_t *master, sector_t *sector, angle_t flatangle, fixed_t xoffs, fixed_t yoffs)
|
static void P_ApplyFlatAlignment(line_t *master, sector_t *sector, angle_t flatangle, fixed_t xoffs, fixed_t yoffs)
|
||||||
{
|
{
|
||||||
if (!(master->flags & ML_NOSONIC)) // Modify floor flat alignment unless NOSONIC flag is set
|
if (!(master->flags & ML_NETONLY)) // Modify floor flat alignment unless ML_NETONLY flag is set
|
||||||
{
|
{
|
||||||
sector->spawn_flrpic_angle = sector->floorpic_angle = flatangle;
|
sector->spawn_flrpic_angle = sector->floorpic_angle = flatangle;
|
||||||
sector->floor_xoffs += xoffs;
|
sector->floor_xoffs += xoffs;
|
||||||
|
@ -6332,7 +6332,7 @@ static void P_ApplyFlatAlignment(line_t *master, sector_t *sector, angle_t flata
|
||||||
sector->spawn_flr_yoffs = sector->floor_yoffs;
|
sector->spawn_flr_yoffs = sector->floor_yoffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(master->flags & ML_NOTAILS)) // Modify ceiling flat alignment unless NOTAILS flag is set
|
if (!(master->flags & ML_NONET)) // Modify ceiling flat alignment unless ML_NONET flag is set
|
||||||
{
|
{
|
||||||
sector->spawn_ceilpic_angle = sector->ceilingpic_angle = flatangle;
|
sector->spawn_ceilpic_angle = sector->ceilingpic_angle = flatangle;
|
||||||
sector->ceiling_xoffs += xoffs;
|
sector->ceiling_xoffs += xoffs;
|
||||||
|
@ -6463,28 +6463,22 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
||||||
// Init line EFFECTs
|
// Init line EFFECTs
|
||||||
for (i = 0; i < numlines; i++)
|
for (i = 0; i < numlines; i++)
|
||||||
{
|
{
|
||||||
if (lines[i].special != 7) // This is a hack. I can at least hope nobody wants to prevent flat alignment with arbitrary skin setups...
|
if (lines[i].special != 7) // This is a hack. I can at least hope nobody wants to prevent flat alignment in netgames...
|
||||||
{
|
{
|
||||||
// set line specials to 0 here too, same reason as above
|
// set line specials to 0 here too, same reason as above
|
||||||
if (netgame || multiplayer)
|
if (netgame || multiplayer)
|
||||||
{
|
{
|
||||||
// future: nonet flag?
|
if ((lines[i].flags & ML_NONET) == ML_NONET)
|
||||||
|
{
|
||||||
|
lines[i].special = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ((lines[i].flags & ML_NETONLY) == ML_NETONLY)
|
else if ((lines[i].flags & ML_NETONLY) == ML_NETONLY)
|
||||||
{
|
{
|
||||||
lines[i].special = 0;
|
lines[i].special = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((players[consoleplayer].charability == CA_THOK && (lines[i].flags & ML_NOSONIC))
|
|
||||||
|| (players[consoleplayer].charability == CA_FLY && (lines[i].flags & ML_NOTAILS))
|
|
||||||
|| (players[consoleplayer].charability == CA_GLIDEANDCLIMB && (lines[i].flags & ML_NOKNUX)))
|
|
||||||
{
|
|
||||||
lines[i].special = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (lines[i].special)
|
switch (lines[i].special)
|
||||||
|
@ -6530,13 +6524,13 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case 7: // Flat alignment - redone by toast
|
case 7: // Flat alignment - redone by toast
|
||||||
if ((lines[i].flags & (ML_NOSONIC|ML_NOTAILS)) != (ML_NOSONIC|ML_NOTAILS)) // If you can do something...
|
if ((lines[i].flags & (ML_NETONLY|ML_NONET)) != (ML_NETONLY|ML_NONET)) // If you can do something...
|
||||||
{
|
{
|
||||||
angle_t flatangle = InvAngle(R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y));
|
angle_t flatangle = InvAngle(R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y));
|
||||||
fixed_t xoffs;
|
fixed_t xoffs;
|
||||||
fixed_t yoffs;
|
fixed_t yoffs;
|
||||||
|
|
||||||
if (lines[i].flags & ML_NOKNUX) // Set offset through x and y texture offsets if NOKNUX flag is set
|
if (lines[i].flags & ML_EFFECT6) // Set offset through x and y texture offsets if ML_EFFECT6 flag is set
|
||||||
{
|
{
|
||||||
xoffs = sides[lines[i].sidenum[0]].textureoffset;
|
xoffs = sides[lines[i].sidenum[0]].textureoffset;
|
||||||
yoffs = sides[lines[i].sidenum[0]].rowoffset;
|
yoffs = sides[lines[i].sidenum[0]].rowoffset;
|
||||||
|
@ -9194,19 +9188,13 @@ static void P_SearchForDisableLinedefs(void)
|
||||||
// that P_InitTagLists literally just created!
|
// that P_InitTagLists literally just created!
|
||||||
lines[i].special = 0;
|
lines[i].special = 0;
|
||||||
|
|
||||||
// Ability flags can disable disable linedefs now, lol
|
|
||||||
if (netgame || multiplayer)
|
if (netgame || multiplayer)
|
||||||
{
|
{
|
||||||
// future: nonet flag?
|
if ((lines[i].flags & ML_NONET) == ML_NONET)
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if ((lines[i].flags & ML_NETONLY) == ML_NETONLY)
|
else if ((lines[i].flags & ML_NETONLY) == ML_NETONLY)
|
||||||
continue; // Net-only never triggers in single player
|
continue; // Net-only never triggers in single player
|
||||||
else if (players[consoleplayer].charability == CA_THOK && (lines[i].flags & ML_NOSONIC))
|
|
||||||
continue;
|
|
||||||
else if (players[consoleplayer].charability == CA_FLY && (lines[i].flags & ML_NOTAILS))
|
|
||||||
continue;
|
|
||||||
else if (players[consoleplayer].charability == CA_GLIDEANDCLIMB && (lines[i].flags & ML_NOKNUX))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Disable any linedef specials with our tag.
|
// Disable any linedef specials with our tag.
|
||||||
for (j = -1; (j = P_FindLineFromLineTag(&lines[i], j)) >= 0;)
|
for (j = -1; (j = P_FindLineFromLineTag(&lines[i], j)) >= 0;)
|
||||||
|
|
Loading…
Reference in New Issue