X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=ship.cpp;h=040e776484253eec93fff1b26ab60acc0d7e567c;hb=0493211fef444777dca7855c0346c914fae47667;hp=1e80194d1299e4bf6e1392f36426c9a3687233dd;hpb=6f572ab2c31518920272aa5ee40a19e1ef7997fe;p=ghostsoverboard diff --git a/ship.cpp b/ship.cpp index 1e80194..040e776 100644 --- a/ship.cpp +++ b/ship.cpp @@ -26,9 +26,10 @@ bool Ship::handleCollisions() if (type == "rock" || type == "octopus") { // drop all ghosts when hitting an obstacle - emit droppingGhosts(ghostsAboard_); - ghostsAboard_ = 0; - updateShipImage(); + + dropAllGhosts(); + + //go back to old position return false; } @@ -46,6 +47,9 @@ bool Ship::handleCollisions() } } + + + return true; //execution can never reach here, this is just to stop the compiler from complaining } void Ship::updateShipImage() @@ -56,6 +60,9 @@ void Ship::updateShipImage() void Ship::dropAllGhosts() { -//TODO + + emit droppingGhosts(ghostsAboard_); + ghostsAboard_ = 0; + updateShipImage(); }