summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Pig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mobs/Pig.cpp')
-rw-r--r--src/Mobs/Pig.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Mobs/Pig.cpp b/src/Mobs/Pig.cpp
index 82901b061..ce5e9dca0 100644
--- a/src/Mobs/Pig.cpp
+++ b/src/Mobs/Pig.cpp
@@ -13,6 +13,11 @@ cPig::cPig(void) :
super("Pig", mtPig, "entity.pig.hurt", "entity.pig.death", 0.9, 0.9),
m_bIsSaddled(false)
{
+ m_EMPersonality = PASSIVE;
+ m_BehaviorBreeder.AttachToMonster(*this);
+ m_BehaviorCoward.AttachToMonster(*this);
+ m_BehaviorItemFollower.AttachToMonster(*this);
+ m_BehaviorWanderer.AttachToMonster(*this);
}
@@ -41,6 +46,9 @@ void cPig::OnRightClicked(cPlayer & a_Player)
{
super::OnRightClicked(a_Player);
+ // Behavior note: saddling is pig-specific. It is not transferrable to other mobs.
+ // Therefore saddling is not a standalone behavior and is hardcoded into the pig.
+
if (m_bIsSaddled)
{
if (m_Attachee != nullptr)
@@ -91,6 +99,9 @@ void cPig::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
return;
}
+ // Behavior note: saddling is pig-specific. It is not transferrable to other mobs.
+ // Therefore saddling is not a standalone behavior and is hardcoded into the pig.
+
// If the attachee player is holding a carrot-on-stick, let them drive this pig:
if (m_bIsSaddled && (m_Attachee != nullptr))
{
@@ -120,7 +131,3 @@ bool cPig::DoTakeDamage(TakeDamageInfo & a_TDI)
}
return true;
}
-
-
-
-