From: Anders R. <ma...@us...> - 2006-05-16 16:18:08
|
Update of /cvsroot/planeshift/planeshift/src/npcclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3149/src/npcclient Modified Files: npcbehave.cpp tribe.cpp Log Message: Re-Commiting my changes that where lost in the SF truble last week. Index: npcbehave.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/npcclient/npcbehave.cpp,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** npcbehave.cpp 13 May 2006 15:55:36 -0000 1.119 --- npcbehave.cpp 16 May 2006 16:17:59 -0000 1.120 *************** *** 2265,2268 **** --- 2265,2280 ---- npc->Printf("MovePath Loc is %1.2f, %1.2f, %1.2f\n",pos.x,pos.y,pos.z); + + // None linear movement so we have to queue DRData updates. + + npcclient->GetNetworkMgr()->QueueDRData(npc->GetEntity(),npc->GetLinMove(),npc->GetDRCounter()); + + if (!npc->GetLinMove()->IsPath()) + { + npc->Printf("we are done..\n"); + npc->ResumeScript(eventmgr, npc->GetBrain()->GetCurrentBehavior() ); + return; + } + } Index: tribe.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/npcclient/tribe.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tribe.cpp 13 May 2006 15:55:36 -0000 1.4 --- tribe.cpp 16 May 2006 16:17:59 -0000 1.5 *************** *** 22,27 **** --- 22,30 ---- #include "tribe.h" + #include "globals.h" #include "util/psdatabase.h" #include "npc.h" + #include "npcclient.h" + #include "npcbehave.h" psTribe::psTribe() *************** *** 66,70 **** --- 69,85 ---- void psTribe::Advance(csTicks when,EventManager *eventmgr) { + for (size_t i=0; i < members.Length(); i++) + { + NPC *npc = members[i]; + + Behavior * behavior = npc->GetCurrentBehavior(); + if (behavior && strcmp(behavior->GetName(),"do nothing")==0) + { + Perception perception("tribe:path1"); + + npcclient->TriggerEvent(npc,&perception); + } + } } |