diff options
author | Paul Gilbert | 2017-01-03 17:23:33 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-01-03 17:23:33 -0500 |
commit | e2dba404a611fd33c522c4a462c4493ce0a52208 (patch) | |
tree | dcabd542bb5539799321770d384fd77fe20053a4 /engines/titanic/npcs | |
parent | 759f69fe1ef445feddb28a1410c4e0821ae7ac40 (diff) | |
download | scummvm-rg350-e2dba404a611fd33c522c4a462c4493ce0a52208.tar.gz scummvm-rg350-e2dba404a611fd33c522c4a462c4493ce0a52208.tar.bz2 scummvm-rg350-e2dba404a611fd33c522c4a462c4493ce0a52208.zip |
TITANIC: Cleanup and fixes for starling puret
Diffstat (limited to 'engines/titanic/npcs')
-rw-r--r-- | engines/titanic/npcs/starlings.cpp | 17 | ||||
-rw-r--r-- | engines/titanic/npcs/starlings.h | 3 |
2 files changed, 13 insertions, 7 deletions
diff --git a/engines/titanic/npcs/starlings.cpp b/engines/titanic/npcs/starlings.cpp index 7e5907f577..ff1c40cf29 100644 --- a/engines/titanic/npcs/starlings.cpp +++ b/engines/titanic/npcs/starlings.cpp @@ -29,34 +29,39 @@ BEGIN_MESSAGE_MAP(CStarlings, CCharacter) ON_MESSAGE(StatusChangeMsg) END_MESSAGE_MAP() -CStarlings::CStarlings() : CCharacter(), _enabled(false) { +bool CStarlings::_dead; + +CStarlings::CStarlings() : CCharacter() { } void CStarlings::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_enabled, indent); + file->writeNumberLine(_dead, indent); CCharacter::save(file, indent); } void CStarlings::load(SimpleFile *file) { file->readNumber(); - _enabled = file->readNumber(); + _dead = file->readNumber(); CCharacter::load(file); } bool CStarlings::EnterViewMsg(CEnterViewMsg *msg) { - if (_enabled) + if (_dead) + // Tis but a flesh wound setVisible(false); else + // Repeatedly play the starlings flying playMovie(MOVIE_REPEAT); return true; } bool CStarlings::StatusChangeMsg(CStatusChangeMsg *msg) { - _enabled = msg->_newStatus == 1; - setVisible(!_enabled); + // I'm not dead.. I'm getting better. + _dead = msg->_newStatus == 1; + setVisible(!_dead); return true; } diff --git a/engines/titanic/npcs/starlings.h b/engines/titanic/npcs/starlings.h index 1998e6490d..4885777087 100644 --- a/engines/titanic/npcs/starlings.h +++ b/engines/titanic/npcs/starlings.h @@ -32,7 +32,8 @@ class CStarlings : public CCharacter { bool EnterViewMsg(CEnterViewMsg *msg); bool StatusChangeMsg(CStatusChangeMsg *msg); private: - bool _enabled; + // This needs to be static to be shared across all starling instances + static bool _dead; public: CLASSDEF; CStarlings(); |