mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Line special 777/778: No Knuckles to mirror slope on opposite plane
This commit is contained in:
parent
1403c49f50
commit
efbec2c252
1 changed files with 42 additions and 5 deletions
|
|
@ -368,10 +368,35 @@ new_vertex_slope
|
|||
return slope;
|
||||
}
|
||||
|
||||
static mapthing_t **
|
||||
flip_slope
|
||||
(
|
||||
mapthing_t ** origin,
|
||||
const sector_t * sector
|
||||
){
|
||||
mapthing_t * copy = Z_Malloc(3 * sizeof (mapthing_t), PU_LEVEL, NULL);
|
||||
mapthing_t ** anchors = Z_Malloc(3 * sizeof (mapthing_t *), PU_LEVEL, NULL);
|
||||
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
memcpy(©[i], origin[i], sizeof copy[i]);
|
||||
|
||||
copy[i].options ^= MTF_OBJECTFLIP;
|
||||
copy[i].z = anchor_height(©[i], sector);
|
||||
|
||||
anchors[i] = ©[i];
|
||||
}
|
||||
|
||||
return anchors;
|
||||
}
|
||||
|
||||
static void
|
||||
slope_sector
|
||||
(
|
||||
pslope_t ** slope,
|
||||
pslope_t ** alt,
|
||||
sector_t * sector,
|
||||
const INT16 flags,
|
||||
const struct anchor_list * list,
|
||||
|
|
@ -382,6 +407,13 @@ slope_sector
|
|||
if (anchors != NULL)
|
||||
{
|
||||
(*slope) = new_vertex_slope(anchors, flags);
|
||||
|
||||
/* No Knuckles - invert slope to opposite side */
|
||||
if (flags & ML_NOKNUX)
|
||||
{
|
||||
(*alt) = new_vertex_slope(flip_slope(anchors, sector), flags);
|
||||
}
|
||||
|
||||
sector->hasslope = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -398,26 +430,31 @@ make_anchored_slope
|
|||
CEILING = 0x2,
|
||||
};
|
||||
|
||||
const INT16 flags = line->flags;
|
||||
INT16 flags = line->flags;
|
||||
|
||||
const int side = ( flags & ML_NOCLIMB ) != 0;
|
||||
|
||||
sector_t * sector;
|
||||
sector_t * s;
|
||||
|
||||
if (side == 0 || flags & ML_TWOSIDED)
|
||||
{
|
||||
sector = sides[line->sidenum[side]].sector;
|
||||
s = sides[line->sidenum[side]].sector;
|
||||
|
||||
if (plane == FLOOR|CEILING)
|
||||
{
|
||||
flags &= ~ML_NOKNUX;
|
||||
}
|
||||
|
||||
if (plane & FLOOR)
|
||||
{
|
||||
slope_sector
|
||||
(§or->f_slope, sector, flags, &floor_anchors, line->tag);
|
||||
(&s->f_slope, &s->c_slope, s, flags, &floor_anchors, line->tag);
|
||||
}
|
||||
|
||||
if (plane & CEILING)
|
||||
{
|
||||
slope_sector
|
||||
(§or->c_slope, sector, flags, &ceiling_anchors, line->tag);
|
||||
(&s->c_slope, &s->f_slope, s, flags, &ceiling_anchors, line->tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue