summaryrefslogtreecommitdiff
path: root/src/koopatlas/pathmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/koopatlas/pathmanager.cpp')
-rw-r--r--src/koopatlas/pathmanager.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index fc17383..38d18d1 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -442,7 +442,7 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
// TJumped
{Tjumped,2.0f,0.0f, -1,-1.0f, SE_NULL,SE_NULL, 0,0},
- // Enter/leave cave, these are handled specially
+ // Enter cave, this is handled specially
{run,1.0f,10.0f, -1,1.0f, SE_NULL,SE_NULL, 0,0},
{run,1.0f,10.0f, -1,1.0f, SE_NULL,SE_NULL, 0,0},
@@ -452,9 +452,12 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
isJumping = (path->animation >= dKPPath_s::JUMP && path->animation <= dKPPath_s::JUMP_WATER);
- if (path->animation == dKPPath_s::ENTER_CAVE || path->animation == dKPPath_s::LEAVE_CAVE) {
+ if (path->animation == dKPPath_s::ENTER_CAVE) {
scaleAnimProgress = 60;
- if (path->animation == dKPPath_s::LEAVE_CAVE)
+ // what direction does this path go in?
+ isScalingUp = (deltaY < 0) ^ reverseThroughPath;
+
+ if (!isScalingUp)
player->scale = (Vec){0.0f,0.0f,0.0f};
}
@@ -464,7 +467,7 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
player->startAnimation(Animations[id].anim, Animations[id].animParam1, Animations[id].animParam2, 0.0f);
- player->rot.y = (Animations[id].forceRotation >= 0) ? Animations[id].forceRotation : direction;
+ player->rot.y = (Animations[id].forceRotation != -1) ? Animations[id].forceRotation : direction;
moveSpeed = (Animations[id].forceSpeed >= 0.0f) ? Animations[id].forceSpeed : 3.0f;
if (Animations[id].repeatEffect) {
@@ -498,7 +501,7 @@ void dWMPathManager_c::moveThroughPath() {
if (scaleAnimProgress >= 0) {
float soFar = scaleAnimProgress * (1.6f / 60.0f);
- float sc = (currentPath->animation == dKPPath_s::ENTER_CAVE) ? (1.6f - soFar) : soFar;
+ float sc = isScalingUp ? soFar : (1.6f - soFar);
player->scale.x = player->scale.y = player->scale.z = sc;
scaleAnimProgress--;