1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-20 03:41:33 +02:00

fix Doppelganger

This commit is contained in:
XProger
2018-12-08 07:43:38 +03:00
parent e75106d2af
commit b59c8bfb6e
2 changed files with 8 additions and 4 deletions

View File

@@ -1454,7 +1454,7 @@ struct Controller {
updateJoints(); updateJoints();
Core::mModel = getMatrix(); Core::mModel = matrix;
if (layers) { if (layers) {
uint32 mask = 0; uint32 mask = 0;

View File

@@ -2447,9 +2447,13 @@ struct Doppelganger : Enemy {
Enemy::updateRoom(); Enemy::updateRoom();
TR::Level::FloorInfo info; 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 = Animation(level, target->getModel());
animation.setAnim(ANIM_FALL, 1); animation.setAnim(ANIM_FALL, 1);
stand = STAND_AIR; stand = STAND_AIR;
@@ -2457,7 +2461,7 @@ struct Doppelganger : Enemy {
} }
if (stand == STAND_AIR) { if (stand == STAND_AIR) {
if (pos.y > info.floor) { if (selfHeight < 128.0f) {
game->checkTrigger(this, true); game->checkTrigger(this, true);
flags.invisible = true; flags.invisible = true;
deactivate(true); deactivate(true);