mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Battle: scale Overtime Barrier to minimap size
This commit is contained in:
parent
8931c7f570
commit
4d24eb71b6
1 changed files with 20 additions and 1 deletions
|
|
@ -830,6 +830,8 @@ void P_CheckTimeLimit(void)
|
|||
thinker_t *th;
|
||||
mobj_t *center = NULL;
|
||||
|
||||
fixed_t rx, ry;
|
||||
|
||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||
{
|
||||
mobj_t *thismo;
|
||||
|
|
@ -861,7 +863,24 @@ void P_CheckTimeLimit(void)
|
|||
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.enabled = 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue