Skip to content

Commit

Permalink
NWN2: Use PtrMap for the areas in Module
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent 67752b0 commit 977bb21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/engines/nwn2/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,6 @@ void Module::loadAreas() {
}

void Module::unloadAreas() {
for (AreaMap::iterator a = _areas.begin(); a != _areas.end(); ++a)
delete a->second;

_areas.clear();
_newArea.clear();

Expand Down
3 changes: 2 additions & 1 deletion src/engines/nwn2/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <map>
#include <set>

#include "src/common/ptrmap.h"
#include "src/common/ustring.h"
#include "src/common/changeid.h"

Expand Down Expand Up @@ -141,7 +142,7 @@ class Module : public NWN2::Object, public NWN2::ObjectContainer {
bool operator<(const Action &s) const;
};

typedef std::map<Common::UString, Area *> AreaMap;
typedef Common::PtrMap<Common::UString, Area> AreaMap;

typedef std::list<Events::Event> EventQueue;
typedef std::multiset<Action> ActionQueue;
Expand Down

0 comments on commit 977bb21

Please sign in to comment.