Skip to content

Commit

Permalink
KOTOR: Register objects with ObjectManager
Browse files Browse the repository at this point in the history
  • Loading branch information
vkremianskii authored and DrMcCoy committed Aug 28, 2018
1 parent 69c307a commit d399205
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/engines/kotor/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

#include "src/common/util.h"
#include "src/common/maths.h"
#include "src/common/uuid.h"

#include "src/aurora/nwscript/objectman.h"

#include "src/engines/kotor/object.h"

Expand All @@ -43,6 +46,9 @@ Object::Object(ObjectType type)
_maxHitPoints(0),
_minOneHitPoint(false),
_room(0) {
_id = Common::generateIDNumber();
ObjectMan.registerObject(this);

_position [0] = 0.0f;
_position [1] = 0.0f;
_position [2] = 0.0f;
Expand All @@ -53,6 +59,7 @@ Object::Object(ObjectType type)
}

Object::~Object() {
ObjectMan.unregisterObject(this);
}

ObjectType Object::getType() const {
Expand Down

0 comments on commit d399205

Please sign in to comment.