ref: 56527561294fdcba72f5493c27ce47fd8f6ccb70
parent: b6af751f7bb5c600454b18e0f0c0dc38f9cca730
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Jul 8 12:46:28 EDT 2020
Deobfuscate some 'tiles-to-units' calculations
--- a/src/BossAlmo2.cpp
+++ b/src/BossAlmo2.cpp
@@ -695,7 +695,7 @@
{
if (npc->x < 192 * 0x200)
npc->direct = 2;
- if (npc->x > (gMap.width - 4) * 0x2000) // Pixel is inconsistent: the assembly code indicates he really used '0x2000' instead of '0x200 * 0x10', which he usually uses
+ if (npc->x > (gMap.width - 4) * (0x200 * 0x10)) // Pixel is inconsistent: the assembly code indicates he really used '0x2000' instead of '0x200 * 0x10', which he usually uses
npc->direct = 0;
if (npc->direct == 0)
@@ -715,11 +715,11 @@
if (npc->count2 == 150)
{
npc->count2 = 0;
- SetNpChar(282, (gMap.width * 0x200 * 0x10) + 0x40, (Random(-1, 3) + 10) * 0x2000, 0, 0, 0, NULL, 0x30);
+ SetNpChar(282, (gMap.width * 0x200 * 0x10) + 0x40, (Random(-1, 3) + 10) * (0x200 * 0x10), 0, 0, 0, NULL, 0x30);
}
else if (npc->count2 == 75)
{
- SetNpChar(282, (gMap.width * 0x200 * 0x10) + 0x40, (Random(-3, 0) + 3) * 0x2000, 0, 0, 0, NULL, 0x30);
+ SetNpChar(282, (gMap.width * 0x200 * 0x10) + 0x40, (Random(-3, 0) + 3) * (0x200 * 0x10), 0, 0, 0, NULL, 0x30);
}
break;