From: <rly...@us...> - 2010-10-11 21:30:04
|
Revision: 6272 http://planeshift.svn.sourceforge.net/planeshift/?rev=6272&view=rev Author: rlydontknow Date: 2010-10-11 21:29:58 +0000 (Mon, 11 Oct 2010) Log Message: ----------- load HPF nav structure prior to loading path network Modified Paths: -------------- trunk/src/npcclient/npcclient.cpp trunk/src/npcclient/npcclient.h Modified: trunk/src/npcclient/npcclient.cpp =================================================================== --- trunk/src/npcclient/npcclient.cpp 2010-10-11 21:28:07 UTC (rev 6271) +++ trunk/src/npcclient/npcclient.cpp 2010-10-11 21:29:58 UTC (rev 6272) @@ -50,6 +50,7 @@ #include "util/strutil.h" #include "util/psutil.h" #include "util/pspathnetwork.h" +#include "util/celhpf.h" #include "net/connection.h" #include "net/clientmsghandler.h" @@ -599,8 +600,12 @@ bool psNPCClient::LoadPathNetwork() { + csRef<iCelHNavStructBuilder> builder = csQueryRegistry<iCelHNavStructBuilder>(objreg); + csString navmesh = configmanager->GetStr("PlaneShift.NPCClient.NavMesh","/planeshift/navmesh"); + navStruct = builder->LoadHNavStruct(vfs, navmesh); + pathNetwork = new psPathNetwork(); - return pathNetwork->Load(engine,db,world); + return pathNetwork->Load(engine,db,world) && navStruct.IsValid(); } bool psNPCClient::LoadLocations() Modified: trunk/src/npcclient/npcclient.h =================================================================== --- trunk/src/npcclient/npcclient.h 2010-10-11 21:28:07 UTC (rev 6271) +++ trunk/src/npcclient/npcclient.h 2010-10-11 21:29:58 UTC (rev 6272) @@ -60,6 +60,7 @@ class Tribe; class psPath; class psPathNetwork; +struct iCelHNavStruct; struct RaceInfo_t { @@ -403,6 +404,8 @@ psPFMaps * GetMaps() { return PFMaps; } + iCelHNavStruct * GetNavStruct() { return navStruct; } + psWorld * GetWorld() { return world; } iEngine * GetEngine() { return engine; } @@ -496,6 +499,7 @@ csHash<NPCType*, const char*> npctypes; csHash<LocationType*, csString> loctypes; psPathNetwork *pathNetwork; + csRef<iCelHNavStruct> navStruct; csArray<NPC*> npcs; csArray<DeferredNPC> npcsDeferred; csArray<Tribe*> tribes; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |