From: <ave...@us...> - 2004-02-28 10:46:16
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11618 Modified Files: GameScript.cpp Log Message: Fix: fixed gamescript (actionoverride is handled in a single place) Index: GameScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.cpp,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** GameScript.cpp 28 Feb 2004 09:40:06 -0000 1.76 --- GameScript.cpp 28 Feb 2004 10:36:48 -0000 1.77 *************** *** 847,851 **** if (func) { Scriptable* scr = GetActorFromObject( Sender, aC->objects[0]); ! if(scr!=Sender) { //this is an Action Override scr->AddAction( Sender->CurrentAction ); --- 847,851 ---- if (func) { Scriptable* scr = GetActorFromObject( Sender, aC->objects[0]); ! if(scr && scr!=Sender) { //this is an Action Override scr->AddAction( Sender->CurrentAction ); *************** *** 929,934 **** if(ac && func(ac, oC->objectFields[j]) ) { tgts->AddTarget(ac); - printf("actor: %x\n",ac); - printf("Adding actor: %s\n",ac->GetName(0)); } } --- 929,932 ---- *************** *** 1629,1633 **** int GameScript::ID_Allegiance(Actor *actor, int parameter) { - printf("Running allegiance checker\n"); int value = actor->GetStat( IE_EA ); switch (parameter) { --- 1627,1630 ---- *************** *** 2566,2570 **** } Scriptable* target = GetActorFromObject( Sender, parameters->objects[1] ); - printf("MovetoTarget is: %x\n", target); if (!target) { Sender->CurrentAction = NULL; --- 2563,2566 ---- *************** *** 2572,2576 **** } Actor* actor = ( Actor* ) Sender; - printf("walkto...\n"); actor->WalkTo( target->XPos, target->YPos ); } --- 2568,2571 ---- *************** *** 2734,2738 **** void GameScript::BeginDialog(Scriptable* Sender, Action* parameters, int Flags) { ! Scriptable* tar, * scr; if (Flags & BD_OWN) { --- 2729,2733 ---- void GameScript::BeginDialog(Scriptable* Sender, Action* parameters, int Flags) { ! Scriptable* tar, *scr; if (Flags & BD_OWN) { *************** *** 2740,2743 **** --- 2735,2739 ---- } else { tar = GetActorFromObject( Sender, parameters->objects[1] ); + scr = Sender; } //source could be other than Actor, we need to handle this too! *************** *** 3413,3432 **** void GameScript::ClearActions(Scriptable* Sender, Action* parameters) { ! Scriptable* scr = GetActorFromObject( Sender, parameters->objects[0] ); ! if (scr) { ! scr->ClearActions(); ! } } void GameScript::SetNumTimesTalkedTo(Scriptable* Sender, Action* parameters) { ! Scriptable* scr = GetActorFromObject( Sender, parameters->objects[0] ); ! if (!scr) { ! return; ! } ! if (scr->Type != ST_ACTOR) { return; } ! Actor* actor = ( Actor* ) scr; actor->TalkCount = parameters->int0Parameter; } --- 3409,3421 ---- void GameScript::ClearActions(Scriptable* Sender, Action* parameters) { ! Sender->ClearActions(); } void GameScript::SetNumTimesTalkedTo(Scriptable* Sender, Action* parameters) { ! if (Sender->Type != ST_ACTOR) { return; } ! Actor* actor = ( Actor* ) Sender; actor->TalkCount = parameters->int0Parameter; } *************** *** 3440,3455 **** Action* parameters) { ! Scriptable* scr = GetActorFromObject( Sender, parameters->objects[0] ); ! if (!scr) { ! return; ! } ! if (scr->Type != ST_ACTOR) { return; } int pdtable = core->LoadTable( "pdialog" ); ! Actor* actor = ( Actor* ) scr; char* scriptingname = actor->GetScriptName(); actor->SetDialog( core->GetTable( pdtable )->QueryField( scriptingname, ! "POST_DIALOG_FILE" ) ); core->DelTable( pdtable ); } --- 3429,3440 ---- Action* parameters) { ! if (Sender->Type != ST_ACTOR) { return; } int pdtable = core->LoadTable( "pdialog" ); ! Actor* actor = ( Actor* ) Sender; char* scriptingname = actor->GetScriptName(); actor->SetDialog( core->GetTable( pdtable )->QueryField( scriptingname, ! "POST_DIALOG_FILE" ) ); core->DelTable( pdtable ); } |