diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-02-22 22:34:05 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-02-22 22:34:05 -0500 |
| commit | 9ec9e0136e958f4e9b08a118c7534b5265659be0 (patch) | |
| tree | 088131a69d5a60622c8b70763c760dd6a8d09514 /sigencore/Creature.cpp | |
| parent | 453a2c0c7f83c53660cbede38ea57fe8502ee7f3 (diff) | |
Creature can now fail to set the containment
Diffstat (limited to 'sigencore/Creature.cpp')
| -rw-r--r-- | sigencore/Creature.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sigencore/Creature.cpp b/sigencore/Creature.cpp index 941d5649..db2950b6 100644 --- a/sigencore/Creature.cpp +++ b/sigencore/Creature.cpp @@ -77,10 +77,14 @@ Sigscript::SigmodWrapper* Sigencore::Creature::sigmod() const return m_sigmod; } -void Sigencore::Creature::setContainment(Containment* containment) +bool Sigencore::Creature::setContainment(Containment* containment) { - m_containment->removeMember(this); - m_containment = containment; + if (m_containment && m_containment->removeMember(this)) + { + m_containment = containment; + return true; + } + return false; } Sigencore::Containment* Sigencore::Creature::containment() const |
