1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-07 21:33:38 +02: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:
Misa 2020-09-09 22:40:15 -07:00 committed by Ethan Lee
parent 140861a79d
commit c325085ddb

View File

@ -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);
}