diff options
author | Florian Kagerer | 2009-05-10 13:40:28 +0000 |
---|---|---|
committer | Florian Kagerer | 2009-05-10 13:40:28 +0000 |
commit | dd84aaf648b57220180b84a9aa0825d16bcea5bc (patch) | |
tree | 2be68b4e4892d1a4d19509a46ebe64206e83e3f4 /engines/kyra/items_lol.cpp | |
parent | 3592801a5707f42c71971321b26e2cc1da775c25 (diff) | |
download | scummvm-rg350-dd84aaf648b57220180b84a9aa0825d16bcea5bc.tar.gz scummvm-rg350-dd84aaf648b57220180b84a9aa0825d16bcea5bc.tar.bz2 scummvm-rg350-dd84aaf648b57220180b84a9aa0825d16bcea5bc.zip |
LOL: - added some spell casting (spark, heal, swarm)
- fixed several bugs (not the one in the fighting system though)
- added several opcodes. there shouldn't be any real show stoppers in the draracle cave now.
- simplified wsa code (which required 4 lines of code for displaying a frame)
- added support for wsa animations that don't have a last frame (apparently kyra 2 and 3 don't have this type of wsa file)
svn-id: r40420
Diffstat (limited to 'engines/kyra/items_lol.cpp')
-rw-r--r-- | engines/kyra/items_lol.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/kyra/items_lol.cpp b/engines/kyra/items_lol.cpp index 02c8e50410..765747f687 100644 --- a/engines/kyra/items_lol.cpp +++ b/engines/kyra/items_lol.cpp @@ -44,7 +44,7 @@ void LoLEngine::giveCredits(int credits, int redraw) { if (t > credits) t = credits; - if (_credits < 60 && t >= 0) { + if (_credits < 60 && t > 0) { cnt = 0; do { @@ -86,7 +86,7 @@ void LoLEngine::takeCredits(int credits, int redraw) { if (t > credits) t = credits; - if (_credits - t < 60 && t >= 0) { + if (_credits - t < 60 && t > 0) { cnt = 0; do { @@ -97,7 +97,7 @@ void LoLEngine::takeCredits(int credits, int redraw) { _moneyColumnHeight[d]--; } } while (++cnt < t); - } else if (_credits - t < 60) { + } else if (_credits - t >= 60) { _credits -= t; } @@ -343,7 +343,7 @@ void LoLEngine::removeLevelItem(int item, int block) { } bool LoLEngine::launchObject(int objectType, int item, int startX, int startY, int flyingHeight, int direction, int, int attackerId, int c) { - int sp = checkDrawObjectSpace(_partyPosX, _partyPosX, startX, startY); + int sp = checkDrawObjectSpace(_partyPosX, _partyPosY, startX, startY); FlyingObject *t = _flyingObjects; int slot = -1; int i = 0; @@ -354,7 +354,7 @@ bool LoLEngine::launchObject(int objectType, int item, int startX, int startY, i break; } - int csp = checkDrawObjectSpace(_partyPosX, _partyPosX, t->x, t->y); + int csp = checkDrawObjectSpace(_partyPosX, _partyPosY, t->x, t->y); if (csp > sp){ sp = csp; slot = i; @@ -490,7 +490,8 @@ void LoLEngine::updateFlyingObject(FlyingObject *t) { int x = 0; int y = 0; getNextStepCoords(t->x, t->y, x, y, t->direction); - int objectOnNextBlock = checkBlockBeforeObjectPlacement(x, y, _itemProperties[_itemsInPlay[t->item].itemPropertyIndex].flags & 0x4000 ? 256 : 63, t->flags, t->wallFlags); + // WORKAROUND: The next line seems to be bugged in the original code. I have fixed it in a way that at least seems to work fine. + int objectOnNextBlock = checkBlockBeforeObjectPlacement(x, y, _itemProperties[_itemsInPlay[t->item].itemPropertyIndex].flags & 0x4000 ? 127 : 63, t->flags, t->wallFlags); if (objectOnNextBlock) { endObjectFlight(t, x, y, objectOnNextBlock); } else { |