mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Battle: scale Overtime Barrier to minimap size
This commit is contained in:
parent
506e0c58c8
commit
835981d299
1 changed files with 20 additions and 1 deletions
|
|
@ -829,6 +829,8 @@ void P_CheckTimeLimit(void)
|
||||||
thinker_t *th;
|
thinker_t *th;
|
||||||
mobj_t *center = NULL;
|
mobj_t *center = NULL;
|
||||||
|
|
||||||
|
fixed_t rx, ry;
|
||||||
|
|
||||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||||
{
|
{
|
||||||
mobj_t *thismo;
|
mobj_t *thismo;
|
||||||
|
|
@ -860,7 +862,24 @@ void P_CheckTimeLimit(void)
|
||||||
battleovertime.z = center->z;
|
battleovertime.z = center->z;
|
||||||
}
|
}
|
||||||
|
|
||||||
battleovertime.initial_radius = 4096 * mapobjectscale;
|
// Get largest radius from center point to minimap edges
|
||||||
|
|
||||||
|
rx = max(
|
||||||
|
abs(battleovertime.x - (minimapinfo.min_x * FRACUNIT)),
|
||||||
|
abs(battleovertime.x - (minimapinfo.max_x * FRACUNIT))
|
||||||
|
);
|
||||||
|
|
||||||
|
ry = max(
|
||||||
|
abs(battleovertime.y - (minimapinfo.min_y * FRACUNIT)),
|
||||||
|
abs(battleovertime.y - (minimapinfo.max_y * FRACUNIT))
|
||||||
|
);
|
||||||
|
|
||||||
|
battleovertime.initial_radius = min(
|
||||||
|
max(max(rx, ry), 4096 * mapobjectscale),
|
||||||
|
// Prevent overflow in K_RunBattleOvertime
|
||||||
|
FixedDiv(INT32_MAX, M_PI_FIXED) / 2
|
||||||
|
);
|
||||||
|
|
||||||
battleovertime.radius = battleovertime.initial_radius;
|
battleovertime.radius = battleovertime.initial_radius;
|
||||||
|
|
||||||
battleovertime.enabled = 1;
|
battleovertime.enabled = 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue