Skip to content

Commit

Permalink
NWN2: Add Trap class to the Trigger class
Browse files Browse the repository at this point in the history
  • Loading branch information
rjshae authored and DrMcCoy committed Nov 23, 2018
1 parent 818fa07 commit 528e87a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engines/nwn2/trigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ void Trigger::load(const Aurora::GFF3Struct &gff) {
if (!utt)
warning("Trigger \"%s\" has no blueprint", temp.c_str());

try {
_trap.reset(new Trap(gff));
} catch (...) {
Common::exceptionDispatcherWarning();
}

float x, y, z;
x = (float)gff.getDouble("XPosition");
y = (float)gff.getDouble("YPosition");
Expand Down
4 changes: 4 additions & 0 deletions src/engines/nwn2/trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "src/engines/aurora/trigger.h"

#include "src/engines/nwn2/object.h"
#include "src/engines/nwn2/trap.h"

namespace Engines {

Expand All @@ -46,6 +47,9 @@ class Trigger : public ::Engines::Trigger, public Object {
protected:
void load(const Aurora::GFF3Struct &gff);
void loadBlueprint(const Aurora::GFF3Struct &gff);

private:
Common::ScopedPtr<Trap> _trap; ///< The trigger's trap.
};

} // End of namespace NWN2
Expand Down

0 comments on commit 528e87a

Please sign in to comment.