VPS
Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/AI/ActionInterface/AITeam.cpp

Diff revisions: vs.
  @@ -20,10 +20,7 @@
20 20 AIManager::getInstance().unregisterTeam(this);
21 21 {
22 22 WriteLock w1_lock(_crowdMutex);
23 - for (AITeamCrowd::value_type& it : _aiTeamCrowd) {
24 - MemoryManager::SAFE_DELETE(it.second);
25 - }
26 - _aiTeamCrowd.clear();
23 + MemoryManager::DELETE_HASHMAP(_aiTeamCrowd);
27 24 }
28 25 {
29 26 WriteLock w2_lock(_updateMutex);
  @@ -36,14 +33,16 @@
36 33 }
37 34
38 35 void AITeam::addCrowd(AIEntity::PresetAgentRadius radius, Navigation::NavigationMesh* navMesh) {
39 - DIVIDE_ASSERT(_aiTeamCrowd.find(radius) == _aiTeamCrowd.end(), "AITeam error: DtCrowd already existed for new navmesh!");
40 - hashAlg::emplace(_aiTeamCrowd, radius, New Navigation::DivideDtCrowd(navMesh));
36 + DIVIDE_ASSERT(_aiTeamCrowd.find(radius) == _aiTeamCrowd.end(),
37 + "AITeam error: DtCrowd already existed for new navmesh!");
38 + hashAlg::emplace(_aiTeamCrowd, radius, MemoryManager_NEW Navigation::DivideDtCrowd(navMesh));
41 39 }
42 40
43 41 void AITeam::removeCrowd(AIEntity::PresetAgentRadius radius) {
44 42 AITeamCrowd::iterator it = _aiTeamCrowd.find(radius);
45 - DIVIDE_ASSERT(it != _aiTeamCrowd.end(), "AITeam error: DtCrowd does not exist for specified navmesh!");
46 - MemoryManager::SAFE_DELETE( it->second );
43 + DIVIDE_ASSERT(it != _aiTeamCrowd.end(),
44 + "AITeam error: DtCrowd does not exist for specified navmesh!");
45 + MemoryManager::DELETE( it->second );
47 46 _aiTeamCrowd.erase(it);
48 47 }
49 48