From b59c8bfb6e32ea53c4f2d26721690394f8120abd Mon Sep 17 00:00:00 2001 From: XProger Date: Sat, 8 Dec 2018 07:43:38 +0300 Subject: [PATCH] fix Doppelganger --- src/controller.h | 2 +- src/enemy.h | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/controller.h b/src/controller.h index 90e6991..a415b9a 100644 --- a/src/controller.h +++ b/src/controller.h @@ -1454,7 +1454,7 @@ struct Controller { updateJoints(); - Core::mModel = getMatrix(); + Core::mModel = matrix; if (layers) { uint32 mask = 0; diff --git a/src/enemy.h b/src/enemy.h index 6cee217..9d14eac 100644 --- a/src/enemy.h +++ b/src/enemy.h @@ -2447,9 +2447,13 @@ struct Doppelganger : Enemy { Enemy::updateRoom(); TR::Level::FloorInfo info; - getFloorInfo(getRoomIndex(), pos, info); + getFloorInfo(getRoomIndex(), target->pos, info); + float laraHeight = info.floor - target->pos.y; - if (stand != STAND_AIR && target->stand == Character::STAND_GROUND && pos.y < info.floor - 1024) { + getFloorInfo(getRoomIndex(), pos, info); + float selfHeight = info.floor - pos.y; + + if (stand != STAND_AIR && target->stand == Character::STAND_GROUND && selfHeight > 1024 && laraHeight < 256) { animation = Animation(level, target->getModel()); animation.setAnim(ANIM_FALL, 1); stand = STAND_AIR; @@ -2457,7 +2461,7 @@ struct Doppelganger : Enemy { } if (stand == STAND_AIR) { - if (pos.y > info.floor) { + if (selfHeight < 128.0f) { game->checkTrigger(this, true); flags.invisible = true; deactivate(true);