]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Person.cpp
Cleaned up dialog handling using a Dialog class
[lugaru.git] / Source / Person.cpp
index 71c0660c2926d45cb9663818af1911277b374384..9e2bc9f4bf7d6cc01604ac4ba46ea205c54cc3b8 100644 (file)
@@ -25,6 +25,7 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Sounds.h"
 #include "Awards.h"
 #include "Game.h"
+#include "Dialog.h"
 
 extern float multiplier;
 extern Terrain terrain;
@@ -65,8 +66,6 @@ extern float damagedealt;
 extern int hostile;
 extern float hostiletime;
 
-extern int indialogue;
-
 extern bool gamestarted;
 
 std::vector<std::shared_ptr<Person>> Person::players(1, std::shared_ptr<Person>(new Person()));
@@ -504,7 +503,7 @@ void Person::CatchFire()
  */
 int Person::getIdle()
 {
-    if (indialogue != -1 && howactive == typeactive && creature == rabbittype)
+    if (Dialog::inDialog() && (howactive == typeactive) && (creature == rabbittype))
         return talkidleanim;
     if (hasvictim && (victim != this->shared_from_this())/*||(id==0&&attackkeydown)*/)
         if (/*(id==0&&attackkeydown)||*/(!victim->dead && victim->aitype != passivetype &&