Added some bugfixes and cleanup
This commit is contained in:
parent
1042d3fcf2
commit
f08c1c3aa6
2 changed files with 20 additions and 7 deletions
|
@ -123,9 +123,15 @@ void ActNpc001(NPCHAR *npc)
|
||||||
if (npc->x <= 0x9FFF)
|
if (npc->x <= 0x9FFF)
|
||||||
npc->cond = 0;
|
npc->cond = 0;
|
||||||
|
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
//Limit speed
|
||||||
|
if (npc->xm < -0x5FF)
|
||||||
|
npc->xm = -0x5FF;
|
||||||
|
#else
|
||||||
//Limit speed (except pixel applied it to the X position)
|
//Limit speed (except pixel applied it to the X position)
|
||||||
if (npc->x < -0x5FF)
|
if (npc->x < -0x5FF)
|
||||||
npc->x = -0x5FF;
|
npc->x = -0x5FF;
|
||||||
|
#endif
|
||||||
|
|
||||||
//Bounce off walls
|
//Bounce off walls
|
||||||
if (npc->flag & 1)
|
if (npc->flag & 1)
|
||||||
|
|
|
@ -57,7 +57,7 @@ void ActNpc080(NPCHAR *npc)
|
||||||
npc->ani_no = 1;
|
npc->ani_no = 1;
|
||||||
npc->ani_wait = 0;
|
npc->ani_wait = 0;
|
||||||
npc->act_no = 2;
|
npc->act_no = 2;
|
||||||
npc->bits &= ~0x20u;
|
npc->bits &= ~0x20;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMC.x >= npc->x)
|
if (gMC.x >= npc->x)
|
||||||
|
@ -91,16 +91,16 @@ void ActNpc080(NPCHAR *npc)
|
||||||
npc->xm = 0x400;
|
npc->xm = 0x400;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMC.x >= npc->x)
|
if (gMC.x < npc->x)
|
||||||
{
|
|
||||||
npc->direct = 2;
|
|
||||||
npc->xm = 0x100;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
npc->direct = 0;
|
npc->direct = 0;
|
||||||
npc->xm = -0x100;
|
npc->xm = -0x100;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
npc->direct = 2;
|
||||||
|
npc->xm = 0x100;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -150,10 +150,17 @@ void ActNpc080(NPCHAR *npc)
|
||||||
if (npc->xm < -0x400)
|
if (npc->xm < -0x400)
|
||||||
npc->xm = -0x400;
|
npc->xm = -0x400;
|
||||||
|
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (npc->ym > 0x5FF)
|
||||||
|
npc->ym = 0x5FF;
|
||||||
|
if (npc->ym < -0x5FF)
|
||||||
|
npc->ym = -0x5FF;
|
||||||
|
#else
|
||||||
if (npc->ym > 0x5FF)
|
if (npc->ym > 0x5FF)
|
||||||
npc->xm = 0x5FF;
|
npc->xm = 0x5FF;
|
||||||
if (npc->ym < -0x5FF)
|
if (npc->ym < -0x5FF)
|
||||||
npc->xm = -0x5FF;
|
npc->xm = -0x5FF;
|
||||||
|
#endif
|
||||||
|
|
||||||
npc->x += npc->xm;
|
npc->x += npc->xm;
|
||||||
npc->y += npc->ym;
|
npc->y += npc->ym;
|
||||||
|
|
Loading…
Add table
Reference in a new issue