fix bug of enemy occasionally dropping off platform occasionally (incorrect int comparison in getMoveLeftPatches function)

This commit is contained in:
2025-01-29 02:56:21 +00:00
parent e2f5f18089
commit abeff178c6

View File

@@ -344,7 +344,8 @@ struct
val yDiff = platY - apexY val yDiff = platY - apexY
in in
if yDiff > xDiff then if yDiff <= xDiff then
(* enemy can reach platform by jumping *)
let let
val acc = val acc =
if standingOnArea (enemy, platformTree) then if standingOnArea (enemy, platformTree) then
@@ -368,7 +369,7 @@ struct
val yDiff = platY - ey val yDiff = platY - ey
in in
if yDiff >= xDiff then if yDiff >= xDiff then
(* can reach next platform by simply dropping and moving right *) (* can reach next platform by simply dropping and moving left *)
EnemyPatch.W_Y_AXIS DROP_BELOW_PLATFORM EnemyPatch.W_Y_AXIS DROP_BELOW_PLATFORM
:: EnemyPatch.W_X_AXIS MOVE_LEFT :: acc :: EnemyPatch.W_X_AXIS MOVE_LEFT :: acc
else else
@@ -380,7 +381,7 @@ struct
val apexY = ey - (Constants.jumpLimit - jumpAmt) val apexY = ey - (Constants.jumpLimit - jumpAmt)
val yDiff = platY - apexY val yDiff = platY - apexY
in in
if yDiff >= xDiff then if yDiff <= xDiff then
(* can reach if we jump and move left *) (* can reach if we jump and move left *)
let let
val acc = val acc =