mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 02:14:09 +03:00
Turn obj.collect and obj.customcollect into plain arrays
Since they're always fixed-size, there's no need for them to be vectors. Also added an INBOUNDS_ARR() macro to do bounds checks with plain arrays.
This commit is contained in:
@@ -1959,8 +1959,8 @@ void scriptclass::run()
|
||||
music.haltdasmusik();
|
||||
music.playef(3);
|
||||
|
||||
int trinket = ss_toi(words[1]);
|
||||
if (trinket >= 0 && trinket < (int) obj.collect.size())
|
||||
size_t trinket = ss_toi(words[1]);
|
||||
if (trinket < SDL_arraysize(obj.collect))
|
||||
{
|
||||
obj.collect[trinket] = true;
|
||||
}
|
||||
@@ -3707,10 +3707,8 @@ void scriptclass::hardreset()
|
||||
obj.customcrewmoods[i]=true;
|
||||
}
|
||||
|
||||
obj.collect.clear();
|
||||
obj.collect.resize(100);
|
||||
obj.customcollect.clear();
|
||||
obj.customcollect.resize(100);
|
||||
SDL_memset(obj.collect, false, sizeof(obj.collect));
|
||||
SDL_memset(obj.customcollect, false, sizeof(obj.customcollect));
|
||||
i = 100; //previously a for-loop iterating over collect/customcollect set this to 100
|
||||
|
||||
int theplayer = obj.getplayer();
|
||||
|
||||
Reference in New Issue
Block a user