mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 23:31:50 +00:00
Effect 4 on a map line now makes the front midtexture solid
(Supports Effect 5 repeating of arbitrary lengths, but not of the automatic "top-to-bottom" type; just use Impassible there!)
This commit is contained in:
parent
a2af7ba305
commit
808775de02
1 changed files with 33 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "p_local.h"
|
||||
#include "r_main.h"
|
||||
#include "r_data.h"
|
||||
#include "p_maputl.h"
|
||||
#include "p_polyobj.h"
|
||||
#include "z_zone.h"
|
||||
|
@ -520,6 +521,38 @@ void P_LineOpening(line_t *linedef)
|
|||
{
|
||||
fixed_t thingtop = tmthing->z + tmthing->height;
|
||||
|
||||
// Check for collision with front side's midtexture if Effect 4 is set
|
||||
if (linedef->flags & ML_EFFECT4) {
|
||||
side_t *side = &sides[linedef->sidenum[0]];
|
||||
fixed_t textop, texbottom, texheight;
|
||||
fixed_t texmid, delta1, delta2;
|
||||
|
||||
// Get the midtexture's height
|
||||
texheight = textures[texturetranslation[side->midtexture]]->height << FRACBITS;
|
||||
|
||||
// Set texbottom and textop to the Z coordinates of the texture's boundaries
|
||||
if (linedef->flags & ML_DONTPEGBOTTOM) {
|
||||
texbottom = openbottom + side->rowoffset;
|
||||
textop = texbottom + texheight*(side->repeatcnt+1);
|
||||
} else {
|
||||
textop = opentop - side->rowoffset;
|
||||
texbottom = textop - texheight*(side->repeatcnt+1);
|
||||
}
|
||||
|
||||
texmid = texbottom+(textop-texbottom)/2;
|
||||
|
||||
delta1 = abs(tmthing->z - texmid);
|
||||
delta2 = abs(thingtop - texmid);
|
||||
|
||||
if (delta1 > delta2) { // Below
|
||||
if (opentop > texbottom)
|
||||
opentop = texbottom;
|
||||
} else { // Above
|
||||
if (openbottom < textop)
|
||||
openbottom = textop;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for fake floors in the sector.
|
||||
if (front->ffloors || back->ffloors
|
||||
#ifdef POLYOBJECTS
|
||||
|
|
Loading…
Reference in a new issue