mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Fix up trinket and coin ID bounds checks
Trinket IDs weren't being bounds-checked upon creation, and coin IDs weren't being bounds-checked upon pickup. But now they both are.
This commit is contained in:
parent
140861a79d
commit
c325085ddb
1 changed files with 5 additions and 2 deletions
|
@ -1434,7 +1434,7 @@ void entityclass::createentity( float xp, float yp, int t, float vx /*= 0*/, flo
|
|||
|
||||
//Check if it's already been collected
|
||||
entity.para = vx;
|
||||
if (collect[(int) vx]) return;
|
||||
if (!INBOUNDS_ARR(vx, collect) || collect[(int) vx]) return;
|
||||
break;
|
||||
case 10: //Savepoint
|
||||
entity.rule = 3;
|
||||
|
@ -2581,7 +2581,10 @@ bool entityclass::updateentities( int i )
|
|||
if (entities[i].state == 1)
|
||||
{
|
||||
music.playef(4);
|
||||
collect[(int) entities[i].para] = true;
|
||||
if (INBOUNDS_ARR(entities[i].para, customcollect))
|
||||
{
|
||||
collect[(int) entities[i].para] = true;
|
||||
}
|
||||
|
||||
return removeentity(i);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue