1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-18 10:38:31 +02:00

Wrap around enemy type when switching enemy types

Whoops. Forgot to do this earlier when adding the Shift+F3 hotkey.
Otherwise the enemy type would become invalid and just turn into the
default square.
This commit is contained in:
Misa 2020-07-17 13:25:23 -07:00 committed by Ethan Lee
parent fb8cb705da
commit af89c52813

View File

@ -1686,15 +1686,21 @@ void editorclass::switch_enemy(const bool reversed /*= false*/)
}
edlevelclass& room = level[roomnum];
int enemy = room.enemytype;
if (reversed)
{
room.enemytype--;
enemy--;
}
else
{
room.enemytype++;
enemy++;
}
const int modulus = 10;
enemy = (enemy % modulus + modulus) % modulus;
room.enemytype = enemy;
note = "Enemy Type Changed";
notedelay = 45;
}