Don't manually write out INBOUNDS_VEC() checks

This is because if they are manually written out, they are more likely
to contain mistakes.

In fact, after further review, there are several functions with
incorrect manually-written bounds checks:
 * entityclass::entitycollide()
 * entityclass::removeentity()
 * entityclass::removeblock()
 * entityclass::copylinecross()
 * entityclass::revertlinecross()

All of those functions forgot to do 'greater than or equal to' instead
of 'greater than' when comparing against the size of the vector. So they
were erroneous. But they are now fixed.
This commit is contained in:
Misa
2020-09-09 21:58:59 -07:00
committed by Ethan Lee
parent 32b6de729d
commit 7b20d90446
4 changed files with 31 additions and 31 deletions

View File

@@ -352,7 +352,7 @@ void musicclass::changemusicarea(int x, int y)
void musicclass::playef(int t)
{
if (t < 0 || t >= (int) soundTracks.size())
if (!INBOUNDS_VEC(t, soundTracks))
{
return;
}