aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2/snail.cpp
diff options
context:
space:
mode:
authoruruk2014-06-13 16:13:36 +0200
committeruruk2014-06-13 16:13:36 +0200
commit95c844a0351d8865aa5190bb5572dff23b8886fd (patch)
tree0554cfaea9b4ba16ff3784c3e1a154a253a235fa /engines/cge2/snail.cpp
parent6ac5e2cfcfa3e13b3eb93c88790c7babcb7af6d2 (diff)
downloadscummvm-rg350-95c844a0351d8865aa5190bb5572dff23b8886fd.tar.gz
scummvm-rg350-95c844a0351d8865aa5190bb5572dff23b8886fd.tar.bz2
scummvm-rg350-95c844a0351d8865aa5190bb5572dff23b8886fd.zip
CGE2: Implement snKill().
Add and implement Sprite::setCave() during the process.
Diffstat (limited to 'engines/cge2/snail.cpp')
-rw-r--r--engines/cge2/snail.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index aa0988f293..07cded033e 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -30,6 +30,7 @@
#include "cge2/hero.h"
#include "cge2/text.h"
#include "cge2/sound.h"
+#include "cge2/events.h"
namespace CGE2 {
@@ -324,7 +325,22 @@ void CommandHandler::runCommand() {
}
void CGE2Engine::snKill(Sprite *spr) {
- warning("STUB: CGE2Engine::snKill()");
+ if (spr) {
+ if (spr->_flags._kept)
+ releasePocket(spr);
+ Sprite *nx = spr->_next;
+ hide1(spr);
+ _vga->_showQ->remove(spr);
+ _eventManager->clearEvent(spr);
+ if (spr->_flags._kill)
+ delete spr;
+ else {
+ spr->setCave(-1);
+ _spare->dispose(spr);
+ }
+ if (nx && nx->_flags._slav)
+ snKill(nx);
+ }
}
void CGE2Engine::snHide(Sprite *spr, int val) {