Skip to content

Commit

Permalink
NWN2: Use PtrList for the area objects
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent 85bed3e commit 67752b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/engines/nwn2/area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ Area::~Area() {

void Area::clear() {
// Delete objects
for (ObjectList::iterator o = _objects.begin(); o != _objects.end(); ++o) {
for (ObjectList::iterator o = _objects.begin(); o != _objects.end(); ++o)
_module->removeObject(**o);
delete *o;
}

_objects.clear();

Expand Down
3 changes: 2 additions & 1 deletion src/engines/nwn2/area.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include "src/common/types.h"
#include "src/common/scopedptr.h"
#include "src/common/ptrlist.h"
#include "src/common/ustring.h"
#include "src/common/mutex.h"

Expand Down Expand Up @@ -147,7 +148,7 @@ class Area : public NWN2::Object, public Events::Notifyable {
Graphics::Aurora::Model *model;
};

typedef std::list<Engines::NWN2::Object *> ObjectList;
typedef Common::PtrList<Engines::NWN2::Object> ObjectList;
typedef std::map<uint32, Engines::NWN2::Object *> ObjectMap;


Expand Down

0 comments on commit 67752b0

Please sign in to comment.