diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 3ec4d7d9..4cdbf91b 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -1399,7 +1399,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[vx]) return; + if (!INBOUNDS(vx, collect) || collect[vx]) return; break; case 9: //Something Shiny entity.rule = 3; @@ -1638,7 +1638,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[ (vx)]) return; + if (INBOUNDS(vx, collect) && !collect[ (vx)]) return; break; case 23: //SWN Enemies //Given a different behavior, these enemies are especially for SWN mode and disappear outside the screen. @@ -1989,7 +1989,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 (customcollect[vx]) return; + if (!INBOUNDS(vx, customcollect) || customcollect[vx]) return; break; case 56: //Custom enemy entity.rule = 1; @@ -2538,9 +2538,13 @@ bool entityclass::updateentities( int i ) //wait for collision if (entities[i].state == 1) { - if (game.intimetrial) + if (INBOUNDS(entities[i].para, collect)) { collect[entities[i].para] = true; + } + + if (game.intimetrial) + { music.playef(25); } else @@ -2548,7 +2552,6 @@ bool entityclass::updateentities( int i ) game.state = 1000; if(music.currentsong!=-1) music.silencedasmusik(); music.playef(3); - collect[entities[i].para] = true; if (game.trinkets() > game.stat_trinkets && !map.custommode) { game.stat_trinkets = game.trinkets(); @@ -3168,9 +3171,13 @@ bool entityclass::updateentities( int i ) } else if (entities[i].state == 1) { - if (game.intimetrial) + if (INBOUNDS(entities[i].para, customcollect)) { customcollect[entities[i].para] = true; + } + + if (game.intimetrial) + { music.playef(27); } else @@ -3179,7 +3186,6 @@ bool entityclass::updateentities( int i ) //music.haltdasmusik(); if(music.currentsong!=-1) music.silencedasmusik(); music.playef(27); - customcollect[entities[i].para] = true; } return removeentity(i);