From 644ef043fbd5279e2a2ff339f0feebed8d03962e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 25 Jan 2018 21:47:30 -0500 Subject: XEEN: Further fixes for starting falls --- engines/xeen/combat.cpp | 3 ++- engines/xeen/interface.cpp | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index 676f8b4005..8900d13e9e 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -140,6 +140,7 @@ void Combat::clearShooting() { } void Combat::giveCharDamage(int damage, DamageType attackType, int charIndex) { + Interface &intf = *_vm->_interface; Party &party = *_vm->_party; Scripts &scripts = *_vm->_scripts; Sound &sound = *_vm->_sound; @@ -228,7 +229,7 @@ void Combat::giveCharDamage(int damage, DamageType attackType, int charIndex) { // Draw the attack effect on the character sprite sound.playFX(fx); - _powSprites.draw(0, frame, Common::Point(Res.CHAR_FACES_X[selectedIndex1], 150)); + intf._charPowSprites.draw(0, frame, Common::Point(Res.CHAR_FACES_X[selectedIndex1], 150)); windows[33].update(); // Reduce damage if power shield active, and set it zero diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 0073552ca0..625f9c68b4 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -878,17 +878,19 @@ void Interface::startFalling(bool flag) { _falling = FALL_1; map.load(party._mazeId); - if (flag && map._isOutdoors && ((party._mazePosition.x & 16) || (party._mazePosition.y & 16))) - map.getNewMaze(); + if (flag) { + if (map._isOutdoors && ((party._mazePosition.x & 16) || (party._mazePosition.y & 16))) + map.getNewMaze(); - _flipGround ^= 1; - draw3d(true); - int tempVal = scripts._v2; - scripts._v2 = 0; - combat.giveCharDamage(party._fallDamage, DT_PHYSICAL, 0); - scripts._v2 = tempVal; + _flipGround ^= 1; + draw3d(true); + int tempVal = scripts._v2; + scripts._v2 = 0; + combat.giveCharDamage(party._fallDamage, DT_PHYSICAL, 0); - _flipGround ^= 1; + scripts._v2 = tempVal; + _flipGround ^= 1; + } } bool Interface::checkMoveDirection(int key) { -- cgit v1.2.3