virtual down down working slightly better

This commit is contained in:
minjaesong
2022-03-31 15:58:59 +09:00
parent faa33d9a81
commit 620ebf4aa4

View File

@@ -291,9 +291,10 @@ open class ActorHumanoid : ActorWithBody, Controllable, Pocketed, Factionable, L
// platform-related hacks
// allow latching down downDownVirtually only when standing on a platform AND not jumping upwards
val occupyingTileHasPlatform = bodyTiles.filterNotNull().any { it.isPlatform }
val feetTileHasPlatform = feetTiles.filterNotNull().any { it.isPlatform }
val feetTileIsAllPlatform = feetTiles.filterNotNull().all { it.isPlatform }
if (isDownDown && feetTileIsAllPlatform && (controllerV?.y ?: 0.0) >= 0.0 ||
occupyingTileHasPlatform && !feetTileIsAllPlatform) { // FIXME this does not account for reverse gravity
occupyingTileHasPlatform && !feetTileHasPlatform) { // FIXME this does not account for reverse gravity
downDownVirtually = true
}
if (downDownVirtually && !occupyingTileHasPlatform && !feetTileIsAllPlatform) {