fix bug of enemy occasionally dropping off platform occasionally (incorrect int comparison in getMoveLeftPatches function)
This commit is contained in:
@@ -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 =
|
||||||
|
|||||||
Reference in New Issue
Block a user