mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-25 05:41:42 +00:00
Merge branch 'lessthan3emeraldshards' into 'next'
Allow less than 3 emerald shards instead of crashing See merge request STJr/SRB2!2433
This commit is contained in:
commit
57e17184d1
1 changed files with 4 additions and 2 deletions
|
@ -831,13 +831,15 @@ void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum)
|
||||||
|
|
||||||
static void P_SpawnEmeraldHunt(void)
|
static void P_SpawnEmeraldHunt(void)
|
||||||
{
|
{
|
||||||
INT32 emer[3], num[MAXHUNTEMERALDS], i, randomkey;
|
INT32 emer[3], num[MAXHUNTEMERALDS], i, amount, randomkey;
|
||||||
fixed_t x, y, z;
|
fixed_t x, y, z;
|
||||||
|
|
||||||
for (i = 0; i < numhuntemeralds; i++)
|
for (i = 0; i < numhuntemeralds; i++)
|
||||||
num[i] = i;
|
num[i] = i;
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
amount = min(numhuntemeralds, 3);
|
||||||
|
|
||||||
|
for (i = 0; i < amount; i++)
|
||||||
{
|
{
|
||||||
// generate random index, shuffle afterwards
|
// generate random index, shuffle afterwards
|
||||||
randomkey = P_RandomKey(numhuntemeralds--);
|
randomkey = P_RandomKey(numhuntemeralds--);
|
||||||
|
|
Loading…
Reference in a new issue