summaryrefslogtreecommitdiffstats
path: root/sigencore/Creature.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-02-22 22:34:05 -0500
committerBen Boeckel <MathStuf@gmail.com>2009-02-22 22:34:05 -0500
commit9ec9e0136e958f4e9b08a118c7534b5265659be0 (patch)
tree088131a69d5a60622c8b70763c760dd6a8d09514 /sigencore/Creature.cpp
parent453a2c0c7f83c53660cbede38ea57fe8502ee7f3 (diff)
Creature can now fail to set the containment
Diffstat (limited to 'sigencore/Creature.cpp')
-rw-r--r--sigencore/Creature.cpp10
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