mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
More consistent chain length
This commit is contained in:
parent
71723a803d
commit
e2e984ec14
1 changed files with 3 additions and 9 deletions
|
|
@ -615,18 +615,12 @@ static void CreatePohbee(player_t *owner, waypoint_t *start, waypoint_t *end, UI
|
||||||
|
|
||||||
// Calculate number of chain segments added per laser.
|
// Calculate number of chain segments added per laser.
|
||||||
size = FixedMul(end->mobj->radius, 3*FRACUNIT/2);
|
size = FixedMul(end->mobj->radius, 3*FRACUNIT/2);
|
||||||
baseSegs = 1 + ((size / start->mobj->scale) / CHAIN_SIZE);
|
segVal = max(1, 1 + ((size / start->mobj->scale) / CHAIN_SIZE) / numLasers);
|
||||||
|
baseSegs = segVal * numLasers;
|
||||||
if (baseSegs < MAXPLAYERS)
|
|
||||||
{
|
|
||||||
baseSegs = MAXPLAYERS;
|
|
||||||
}
|
|
||||||
|
|
||||||
segVal = baseSegs / numLasers;
|
|
||||||
|
|
||||||
// Valid spawning conditions,
|
// Valid spawning conditions,
|
||||||
// we can start creating each individual part.
|
// we can start creating each individual part.
|
||||||
pohbee = P_SpawnMobjFromMobj(start->mobj, 0, 0, FixedDiv(size, mapobjectscale) + POHBEE_HOVER * 3, MT_SHRINK_POHBEE);
|
pohbee = P_SpawnMobjFromMobj(start->mobj, 0, 0, (baseSegs * CHAIN_SIZE * FRACUNIT) + POHBEE_HOVER * 3, MT_SHRINK_POHBEE);
|
||||||
P_SetTarget(&pohbee_owner(pohbee), owner->mo);
|
P_SetTarget(&pohbee_owner(pohbee), owner->mo);
|
||||||
|
|
||||||
pohbee_mode(pohbee) = POHBEE_MODE_SPAWN;
|
pohbee_mode(pohbee) = POHBEE_MODE_SPAWN;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue