HYPNO: avoid always resetting stats and correctly count missed targets

This commit is contained in:
neuromancer 2022-06-11 16:14:42 +02:00
parent fd71173beb
commit 6408c8c9e8
2 changed files with 3 additions and 4 deletions

View File

@ -205,8 +205,6 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
Common::Point mousePos;
Common::List<uint32> shootsToRemove;
// statistics
resetStatistics();
// segment/shoots
Segments segments = arc->segments;
@ -496,8 +494,8 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
uint32 bodyLastFrame = it->bodyFrames[it->bodyFrames.size() - 1].lastFrame();
if (frame > 0 && frame >= (int)(bodyLastFrame - 3) && !it->destroyed) {
missedTarget(it, arc);
incTargetsMissed();
missedTarget(it, arc);
// No need to pop attackFrames or explosionFrames
skipVideo(*it->video);
shootsToRemove.push_back(i);
@ -512,6 +510,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
uint32 bodyLastFrame = it->bodyFrames[it->bodyFrames.size() - 1].lastFrame();
if (frame > it->startFrame && frame - it->startFrame >= bodyLastFrame - 3)
if (!it->destroyed) {
incTargetsMissed();
missedTarget(it, arc);
shootsToRemove.push_back(i);
}

View File

@ -36,7 +36,7 @@ static const int shootOriginIndex[9][2] = {
void SpiderEngine::runBeforeArcade(ArcadeShooting *arc) {
_health = arc->health;
_maxHealth = _health;
resetStatistics();
_checkpoint = _currentLevel;
assert(!arc->player.empty());
_playerFrames = decodeFrames(arc->player);