mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Don't select items in the air or with the Ambush flag for overtime
This commit is contained in:
parent
54066cc9fc
commit
7cfcb2f61a
1 changed files with 10 additions and 1 deletions
|
|
@ -1857,15 +1857,24 @@ void P_CheckTimeLimit(void)
|
||||||
continue;
|
continue;
|
||||||
if (thismo->threshold == 69) // Disappears
|
if (thismo->threshold == 69) // Disappears
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
b++;
|
b++;
|
||||||
|
|
||||||
|
// Only select items that are on the ground, ignore ones in the air. Ambush flag inverts this rule.
|
||||||
|
if ((!P_IsObjectOnGround(thismo)) != (thismo->flags2 & MF2_AMBUSH))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (item == NULL || (b < nummapboxes && P_RandomChance(((nummapboxes-b)*FRACUNIT)/nummapboxes))) // This is to throw off the RNG some
|
if (item == NULL || (b < nummapboxes && P_RandomChance(((nummapboxes-b)*FRACUNIT)/nummapboxes))) // This is to throw off the RNG some
|
||||||
item = thismo;
|
item = thismo;
|
||||||
if (b >= nummapboxes) // end early if we've found them all already
|
if (b >= nummapboxes) // end early if we've found them all already
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item == NULL) // no item found?!
|
if (item == NULL) // no item found, could happen if every item is in the air or has ambush flag, or the map has none
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_WARNING, "No usuable items for Battle overtime!\n");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
item->threshold = 70; // Set constant respawn
|
item->threshold = 70; // Set constant respawn
|
||||||
battleovertime.x = item->x;
|
battleovertime.x = item->x;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue