From 594d3cef4f9f16318e978cb38748ac14bbd6a330 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 8 Aug 2010 15:12:53 +0200 Subject: [PATCH] added test for actor class --- apps/openmw/mwdialogue/dialoguemanager.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwdialogue/dialoguemanager.cpp b/apps/openmw/mwdialogue/dialoguemanager.cpp index a862af06d7..4f99d3a056 100644 --- a/apps/openmw/mwdialogue/dialoguemanager.cpp +++ b/apps/openmw/mwdialogue/dialoguemanager.cpp @@ -197,7 +197,17 @@ namespace MWDialogue return false; } - // TODO check actor class + if (!info.clas.empty()) + { + ESMS::LiveCellRef *cellRef = actor.get(); + + if (!cellRef) + return false; + + if (toLower (info.clas)!=toLower (cellRef->base->cls)) + return false; + } + // TODO check actor faction // TODO check player faction @@ -215,7 +225,6 @@ namespace MWDialogue std::cout << "unchecked entries:" << std::endl - << " actor class: " << info.clas << std::endl << " actor faction: " << info.npcFaction << std::endl << " player faction: " << info.pcFaction << std::endl << " DATAstruct" << std::endl;