From: Laszlo T. <ave...@us...> - 2005-11-11 22:33:22
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31543 Modified Files: GSUtils.cpp Log Message: additional checks to make sure dead actors can't talk Index: GSUtils.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GSUtils.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** GSUtils.cpp 6 Nov 2005 14:03:09 -0000 1.24 --- GSUtils.cpp 11 Nov 2005 22:33:14 -0000 1.25 *************** *** 277,280 **** --- 277,283 ---- } + if (target->InternalFlags&IF_REALLYDIED) { + return 0; + } //we should rather use STATE_SPEECHLESS_MASK if (target->GetStat(IE_STATE_ID)&STATE_DEAD) { *************** *** 635,638 **** --- 638,656 ---- speaker = (Actor *) scr; target = (Actor *) tar; + if (!ValidForDialogCore(scr, target) ) { + printf("ValidForDialogCore returned false! Speaker and target are:\n"); + ((Actor *) scr)->DebugDump(); + ((Actor *) tar)->DebugDump(); + Sender->CurrentAction = NULL; + return; + } + if (speaker->GetStat(IE_STATE_ID)&STATE_DEAD) { + printf("Speaker is dead, cannot start dialogue. Speaker and target are:\n"); + ((Actor *) scr)->DebugDump(); + ((Actor *) tar)->DebugDump(); + Sender->CurrentAction = NULL; + return; + } + //CHECKDIST works only for mobile scriptables if (Flags&BD_CHECKDIST) { |