ref: deb0538d03080868d1da9e6833f52c768d5955fa
parent: a9940c9ca97bffe29aa9af548515080f05c2b3f5
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sat Jun 29 20:20:32 EDT 2019
Boss.cpp cleanup
--- a/src/Boss.cpp
+++ b/src/Boss.cpp
@@ -36,7 +36,9 @@
void PutBossChar(int fx, int fy)
{
char a = 0;
- for (int b = BOSS_MAX - 1; b >= 0; b--)
+ int b;
+
+ for (b = BOSS_MAX - 1; b >= 0; --b)
{
if (gBoss[b].cond & 0x80)
{
@@ -78,17 +80,17 @@
void HitBossBullet()
{
- int bos;
+ BOOL bHit;
int bul;
+ int bos;
int bos_;
- BOOL bHit;
- for (bos = 0; bos < BOSS_MAX; bos++)
+ for (bos = 0; bos < BOSS_MAX; ++bos)
{
if ((gBoss[bos].cond & 0x80) == 0)
continue;
- for (bul = 0; bul < BULLET_MAX; bul++)
+ for (bul = 0; bul < BULLET_MAX; ++bul)
{
if ((gBul[bul].cond & 0x80) == 0)
continue;
@@ -180,7 +182,7 @@
}
else
{
- if (!(gBul[bul].bbits & 0x10))
+ if ((gBul[bul].bbits & 0x10) == 0)
{
SetCaret(gBul[bul].x, gBul[bul].y, 2, 2);
PlaySoundObject(31, 1);
@@ -224,11 +226,9 @@
gpBossFuncTbl[code_char]();
- for (bos = 0; bos < BOSS_MAX; bos++)
- {
+ for (bos = 0; bos < BOSS_MAX; ++bos)
if (gBoss[bos].shock)
- gBoss[bos].shock--;
- }
+ --gBoss[bos].shock;
}
void HitBossMap()
@@ -275,7 +275,7 @@
offy[14] = -1;
offy[15] = -1;
- for (b = 0; b < BOSS_MAX; b++)
+ for (b = 0; b < BOSS_MAX; ++b)
{
int judg;
@@ -299,7 +299,7 @@
}
gBoss[b].flag = 0;
- for (j = 0; j < judg; j++)
+ for (j = 0; j < judg; ++j)
{
atrb[j] = GetAttribute(x + offx[j], y + offy[j]);