mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Merge branch 'anchors-on-slopes' into 'master'
Offset slope anchors from regular slopes See merge request KartKrew/Kart!319
This commit is contained in:
commit
a0621b92f9
1 changed files with 7 additions and 4 deletions
|
|
@ -118,13 +118,16 @@ anchor_height
|
||||||
const mapthing_t * a,
|
const mapthing_t * a,
|
||||||
const sector_t * s
|
const sector_t * s
|
||||||
){
|
){
|
||||||
|
const fixed_t x = a->x << FRACBITS;
|
||||||
|
const fixed_t y = a->y << FRACBITS;
|
||||||
|
|
||||||
if (a->options & MTF_OBJECTFLIP)
|
if (a->options & MTF_OBJECTFLIP)
|
||||||
{
|
{
|
||||||
return ( s->ceilingheight >> FRACBITS ) - a->z;
|
return ( P_GetSectorCeilingZAt(s, x, y) >> FRACBITS ) - a->z;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return ( s->floorheight >> FRACBITS ) + a->z;
|
return ( P_GetSectorFloorZAt(s, x, y) >> FRACBITS ) + a->z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -144,13 +147,13 @@ set_anchor
|
||||||
|
|
||||||
fixed_t closeness;
|
fixed_t closeness;
|
||||||
|
|
||||||
a->z = anchor_height(a, sub->sector);
|
|
||||||
|
|
||||||
v = nearest_point(&closeness, a, sub->sector);
|
v = nearest_point(&closeness, a, sub->sector);
|
||||||
|
|
||||||
a->x = ( v->x >> FRACBITS );
|
a->x = ( v->x >> FRACBITS );
|
||||||
a->y = ( v->y >> FRACBITS );
|
a->y = ( v->y >> FRACBITS );
|
||||||
|
|
||||||
|
a->z = anchor_height(a, sub->sector);
|
||||||
|
|
||||||
list->anchors [list->count] = a;
|
list->anchors [list->count] = a;
|
||||||
list->points [list->count] = v;
|
list->points [list->count] = v;
|
||||||
list->closeness[list->count] = closeness;
|
list->closeness[list->count] = closeness;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue