Skip to content

Commit

Permalink
NWN2: Set the creature detecting the trap
Browse files Browse the repository at this point in the history
  • Loading branch information
rjshae authored and DrMcCoy committed Nov 23, 2018
1 parent 395112d commit 2709ce0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/engines/nwn2/trap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ bool Trap::isTriggeredBy(Creature *triggerBy) const {
if (!_isTrap)
return false;

assert(triggerBy);

// TODO: Check if faction is non-hostile

// Check if active
Expand Down Expand Up @@ -161,6 +163,8 @@ void Trap::setTrapDetectable(bool detectable) {
/** Store the creature detecting the trap */
void Trap::setTrapDetectedBy(Creature *detector) {
// TODO
assert(detector);
_detectedBy = detector->getID();
}

/** Set the disarmable state */
Expand Down Expand Up @@ -204,6 +208,8 @@ bool Trap::detectTrap(Creature *agent) {
if ((_detectedBy != 0) || _isFlagged)
return true;

assert(agent);

// TODO
return false;
}
Expand All @@ -219,12 +225,16 @@ bool Trap::disarmTrap(Creature *agent, int adjustDC) {
if (!_isTrapActive)
return true;

assert(agent);

// TODO
return false;
}

/** The object has triggered the trap */
bool Trap::triggerTrap(Object *object) {
assert(object);

// TODO
return true;
}
Expand Down

0 comments on commit 2709ce0

Please sign in to comment.