aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-01-25 21:47:30 -0500
committerPaul Gilbert2018-01-25 21:47:30 -0500
commit644ef043fbd5279e2a2ff339f0feebed8d03962e (patch)
tree0cd1f5e00156472275735dc6b92ff469ac2dbc08
parentb85d6101d300bba1cf305b9306c7d8477bd855c6 (diff)
downloadscummvm-rg350-644ef043fbd5279e2a2ff339f0feebed8d03962e.tar.gz
scummvm-rg350-644ef043fbd5279e2a2ff339f0feebed8d03962e.tar.bz2
scummvm-rg350-644ef043fbd5279e2a2ff339f0feebed8d03962e.zip
XEEN: Further fixes for starting falls
-rw-r--r--engines/xeen/combat.cpp3
-rw-r--r--engines/xeen/interface.cpp20
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) {