mirror of
https://github.com/nzp-team/quakec.git
synced 2025-04-13 05:21:34 +00:00
SERVER: Give up after X attempts to pick random Perk-A-Cola
This commit is contained in:
parent
c367fdc844
commit
217e34b05e
1 changed files with 5 additions and 1 deletions
|
@ -643,7 +643,8 @@ void() Perk_RandomDecide =
|
|||
}
|
||||
|
||||
// Choose which of the eight machines we want to become, if permitted.
|
||||
while (true) {
|
||||
float num_attempts;
|
||||
for(num_attempts = 64; num_attempts > 0; num_attempts--) {
|
||||
i = random();
|
||||
// Quick Revive
|
||||
if (i < (1/8) && (self.spawnflags & SPAWNFLAG_PERKRANDOM_QUICKREVIVE)) {
|
||||
|
@ -694,6 +695,9 @@ void() Perk_RandomDecide =
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!num_attempts)
|
||||
objerror("perk_random: Failed 64 times to pick a Perk-A-Cola. Bailing!\n");
|
||||
};
|
||||
|
||||
void() Perk_RandomPrecaches =
|
||||
|
|
Loading…
Reference in a new issue