From: Jorrit T. <jo...@us...> - 2005-04-01 20:03:22
|
Update of /cvsroot/planeshift/planeshift/src/npcclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16144/src/npcclient Modified Files: npc.cpp npc.h npcclient.cpp npcclient.h Log Message: - Fixed PS for csHashMap and csHashSet removal in CS. Note taht this change is compatible. You don't have to update CS. Index: npc.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/npcclient/npc.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** npc.cpp 13 Mar 2005 09:34:50 -0000 1.55 --- npc.cpp 1 Apr 2005 20:02:14 -0000 1.56 *************** *** 349,353 **** void HateList::AddHate(int entity_id,float delta) { ! HateListEntry *h = (HateListEntry *)hatelist.Get(entity_id); if (!h) { --- 349,353 ---- void HateList::AddHate(int entity_id,float delta) { ! HateListEntry *h = hatelist.Get(entity_id, 0); if (!h) { *************** *** 371,375 **** for (size_t i=0; i<list->GetCount(); i++) { ! HateListEntry *h = (HateListEntry *)hatelist.Get( list->Get(i)->GetID() ); if (h) { --- 371,375 ---- for (size_t i=0; i<list->GetCount(); i++) { ! HateListEntry *h = hatelist.Get( list->Get(i)->GetID(),0 ); if (h) { *************** *** 407,411 **** float HateList::GetHate(int ent) { ! HateListEntry *h = (HateListEntry *)hatelist.Get(ent); if (h) return h->hate_amount; --- 407,411 ---- float HateList::GetHate(int ent) { ! HateListEntry *h = hatelist.Get(ent, 0); if (h) return h->hate_amount; *************** *** 416,420 **** void HateList::DumpHateList() { ! csGlobalHashIterator iter(&hatelist); CPrintf(CON_CMDOUTPUT, "HateList:\n---------\n"); --- 416,420 ---- void HateList::DumpHateList() { ! csHash<HateListEntry*>::GlobalIterator iter = hatelist.GetIterator(); CPrintf(CON_CMDOUTPUT, "HateList:\n---------\n"); Index: npc.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/npcclient/npc.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** npc.h 13 Mar 2005 09:34:50 -0000 1.39 --- npc.h 1 Apr 2005 20:02:24 -0000 1.40 *************** *** 24,28 **** #define __NPC_H__ ! #include <csutil/hashmap.h> #include "npcbehave.h" --- 24,28 ---- #define __NPC_H__ ! #include <csutil/hash.h> #include "npcbehave.h" *************** *** 41,45 **** { protected: ! csHashMap hatelist; public: --- 41,45 ---- { protected: ! csHash<HateListEntry*> hatelist; public: Index: npcclient.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/npcclient/npcclient.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** npcclient.cpp 8 Mar 2005 05:55:45 -0000 1.65 --- npcclient.cpp 1 Apr 2005 20:02:24 -0000 1.66 *************** *** 558,562 **** AttachNPC( actor->GetEntity(), npcs[j] ); npc->SetAlive(true); ! npc_entities.Put((csHashKey)actor->GetEntity()->GetID() ,(csHashObject)actor->GetEntity() ); CPrintf(CON_NOTIFY,"We are now managing NPC: %s(%d) EID %u.\n", actor->GetName(), actor->GetPlayerID(), actor->GetEntity()->GetID()); --- 558,562 ---- AttachNPC( actor->GetEntity(), npcs[j] ); npc->SetAlive(true); ! npc_entities.Put(actor->GetEntity()->GetID() ,actor->GetEntity() ); CPrintf(CON_NOTIFY,"We are now managing NPC: %s(%d) EID %u.\n", actor->GetName(), actor->GetPlayerID(), actor->GetEntity()->GetID()); *************** *** 588,592 **** NPC *psNPCClient::FindNPC(PS_ID entid) { ! iCelEntity *ent = (iCelEntity *)npc_entities.Get( entid ); if (ent) { --- 588,592 ---- NPC *psNPCClient::FindNPC(PS_ID entid) { ! iCelEntity *ent = npc_entities.Get( entid, 0 ); if (ent) { *************** *** 636,640 **** if (ent) { ! iCelEntity *npc = (iCelEntity *)npc_entities.Get( ent->GetID() ); if (npc) { --- 636,640 ---- if (ent) { ! iCelEntity *npc = npc_entities.Get( ent->GetID(), 0 ); if (npc) { Index: npcclient.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/npcclient/npcclient.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** npcclient.h 8 Mar 2005 05:55:45 -0000 1.40 --- npcclient.h 1 Apr 2005 20:02:25 -0000 1.41 *************** *** 22,26 **** #include <csutil/ref.h> #include <csutil/csstring.h> ! #include <csutil/hashmap.h> #include "net/pstypes.h" --- 22,26 ---- #include <csutil/ref.h> #include <csutil/csstring.h> ! #include <csutil/hash.h> #include "net/pstypes.h" *************** *** 243,247 **** BinaryRBTree<Waypoint> waypoints; csArray<NPC*> npcs; ! csHashMap npc_entities; csArray<gemNPCObject*> objects; --- 243,247 ---- BinaryRBTree<Waypoint> waypoints; csArray<NPC*> npcs; ! csHash<iCelEntity*> npc_entities; csArray<gemNPCObject*> objects; |