Merge pull request #101 from GabrielRavier/fixPortableBugs2
Fixed a bunch of npc->cond = 0 bugs
This commit is contained in:
commit
12e4be58ac
5 changed files with 28 additions and 0 deletions
|
@ -1640,7 +1640,10 @@ void ActBullet_Edge(BULLET *bul)
|
|||
bul->damage = 1;
|
||||
|
||||
if (bul->ani_no > 4)
|
||||
{
|
||||
bul->cond = 0;
|
||||
return; // Prevent UB at rc[bul->ani_no] when bul->ani_no == 5
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,10 @@ void ActCaret01(CARET *crt)
|
|||
{
|
||||
crt->ani_wait = 0;
|
||||
if (++crt->ani_no > 3)
|
||||
{
|
||||
crt->cond = 0;
|
||||
return; // Prevent UB at rc[crt->ani_no] when crt->ani_no == 4
|
||||
}
|
||||
}
|
||||
|
||||
// Note that 'crt->ani_no' can exceed the size of 'rcLeft' and 'rcRight'
|
||||
|
@ -247,7 +250,10 @@ void ActCaret07(CARET *crt)
|
|||
crt->ani_wait = 0;
|
||||
|
||||
if (++crt->ani_no > 6)
|
||||
{
|
||||
crt->cond = 0;
|
||||
return; // Prevent UB at rcLeft[crt->ani_no] when crt->ani_no == 6
|
||||
}
|
||||
}
|
||||
|
||||
// Note that 'crt->ani_no' can exceed the size of rcLeft
|
||||
|
@ -453,7 +459,10 @@ void ActCaret14(CARET *crt)
|
|||
crt->ani_wait = 0;
|
||||
|
||||
if (++crt->ani_no > 4)
|
||||
{
|
||||
crt->cond = 0;
|
||||
return; // Prevent UB at rect[crt->ani_no] when crt->ani_no == 5
|
||||
}
|
||||
}
|
||||
|
||||
// Note that 'crt->ani_no' can exceed the size of 'rect'
|
||||
|
@ -475,7 +484,10 @@ void ActCaret15(CARET *crt)
|
|||
crt->ani_wait = 0;
|
||||
|
||||
if (++crt->ani_no > 3)
|
||||
{
|
||||
crt->cond = 0;
|
||||
return; // Prevent UB at rcLeft[crt->ani_no] when crt->ani_no == 4
|
||||
}
|
||||
}
|
||||
|
||||
// Note that 'crt->ani_no' can exceed the size of 'rcLeft'
|
||||
|
|
|
@ -585,7 +585,10 @@ void ActNpc127(NPCHAR *npc)
|
|||
{
|
||||
npc->ani_wait = 0;
|
||||
if (++npc->ani_no > 2)
|
||||
{
|
||||
npc->cond = 0;
|
||||
return; // Prevent UB at rc[npc->ani_no] when npc->ani_no == 3
|
||||
}
|
||||
}
|
||||
|
||||
// Note that 'npc->ani_no' can exceed the size of 'rcH' and 'rcV'
|
||||
|
@ -648,7 +651,10 @@ void ActNpc128(NPCHAR *npc)
|
|||
}
|
||||
|
||||
if (++npc->ani_no > 4)
|
||||
{
|
||||
npc->cond = 0;
|
||||
return; // Prevent UB at rc[npc->ani_no] when npc->ani_no == 5
|
||||
}
|
||||
|
||||
// Note that 'npc->ani_no' can exceed the bounds of 'rcLeft', 'rcUp', 'rcRight' and 'rcDown'
|
||||
|
||||
|
@ -701,7 +707,10 @@ void ActNpc129(NPCHAR *npc)
|
|||
npc->ani_wait = 0;
|
||||
|
||||
if (++npc->ani_no > 2)
|
||||
{
|
||||
npc->cond = 0;
|
||||
return; // Prevent UB at rect[(npc->direct * 3) + npc->ani_no] when npc->direct == 5 and npc->ani_no == 3
|
||||
}
|
||||
}
|
||||
|
||||
npc->y += npc->ym;
|
||||
|
|
|
@ -753,6 +753,7 @@ void ActNpc146(NPCHAR *npc)
|
|||
{
|
||||
SetDestroyNpChar(npc->x, npc->y, 0x1000, 8);
|
||||
npc->cond = 0;
|
||||
return; // Prevent UB at rect[npc->ani_no] when npc->ani_no == 5
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -1426,7 +1426,10 @@ void ActNpc199(NPCHAR *npc)
|
|||
}
|
||||
|
||||
if (npc->ani_no > 4)
|
||||
{
|
||||
npc->cond = 0;
|
||||
return; // Prevent UB at rect[npc->ani_no] when npc->ani_no == 5
|
||||
}
|
||||
|
||||
npc->x += npc->xm;
|
||||
npc->y += npc->ym;
|
||||
|
|
Loading…
Add table
Reference in a new issue