summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-24 14:53:57 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-24 14:53:57 +0200
commit6219d4af217e367336f6a4f7d0a85921c823c161 (patch)
tree1e45576ca1b349456a23b764c80f43d11a778436 /src/Mobs
parentwhitespace cleanup (diff)
parentUse ref instead of pointer (diff)
downloadcuberite-6219d4af217e367336f6a4f7d0a85921c823c161.tar
cuberite-6219d4af217e367336f6a4f7d0a85921c823c161.tar.gz
cuberite-6219d4af217e367336f6a4f7d0a85921c823c161.tar.bz2
cuberite-6219d4af217e367336f6a4f7d0a85921c823c161.tar.lz
cuberite-6219d4af217e367336f6a4f7d0a85921c823c161.tar.xz
cuberite-6219d4af217e367336f6a4f7d0a85921c823c161.tar.zst
cuberite-6219d4af217e367336f6a4f7d0a85921c823c161.zip
Diffstat (limited to 'src/Mobs')
-rw-r--r--src/Mobs/Monster.cpp12
-rw-r--r--src/Mobs/Monster.h2
-rw-r--r--src/Mobs/Sheep.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 6e7e175a3..9759bceb0 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -478,7 +478,7 @@ void cMonster::CalcLeashActions()
auto LeashKnot = cLeashKnot::FindKnotAtPos(*m_World, { FloorC(m_LeashToPos->x), FloorC(m_LeashToPos->y), FloorC(m_LeashToPos->z) });
if (LeashKnot != nullptr)
{
- LeashTo(LeashKnot);
+ LeashTo(*LeashKnot);
SetLeashToPos(nullptr);
}
}
@@ -734,7 +734,7 @@ void cMonster::OnRightClicked(cPlayer & a_Player)
{
a_Player.GetInventory().RemoveOneEquippedItem();
}
- LeashTo(&a_Player);
+ LeashTo(a_Player);
}
}
@@ -1380,7 +1380,7 @@ cMonster::eFamily cMonster::GetMobFamily(void) const
-void cMonster::LeashTo(cEntity * a_Entity, bool a_ShouldBroadcast)
+void cMonster::LeashTo(cEntity & a_Entity, bool a_ShouldBroadcast)
{
// Do nothing if already leashed
if (m_LeashedTo != nullptr)
@@ -1388,13 +1388,13 @@ void cMonster::LeashTo(cEntity * a_Entity, bool a_ShouldBroadcast)
return;
}
- m_LeashedTo = a_Entity;
+ m_LeashedTo = &a_Entity;
- a_Entity->AddLeashedMob(this);
+ a_Entity.AddLeashedMob(this);
if (a_ShouldBroadcast)
{
- m_World->BroadcastLeashEntity(*this, *a_Entity);
+ m_World->BroadcastLeashEntity(*this, a_Entity);
}
m_IsLeashActionJustDone = true;
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 32091d6f9..44497723c 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -89,7 +89,7 @@ public:
bool IsLeashed() const { return (m_LeashedTo != nullptr); }
/** Leash the monster to an entity. */
- void LeashTo(cEntity * a_Entity, bool a_ShouldBroadcast = true);
+ void LeashTo(cEntity & a_Entity, bool a_ShouldBroadcast = true);
/** Unleash the monster. Overload for the Unleash(bool, bool) function for plugins */
void Unleash(bool a_ShouldDropLeashPickup);
diff --git a/src/Mobs/Sheep.h b/src/Mobs/Sheep.h
index 9089cb592..01f90c968 100644
--- a/src/Mobs/Sheep.h
+++ b/src/Mobs/Sheep.h
@@ -33,7 +33,7 @@ public:
}
/** Generates a random color for the sheep like the vanilla server.
- The percent's where used are from the wiki: http://minecraft.gamepedia.com/Sheep#Breeding */
+ The percent's where used are from the wiki: https://minecraft.gamepedia.com/Sheep#Breeding */
static NIBBLETYPE GenerateNaturalRandomColor(void);
bool IsSheared(void) const { return m_IsSheared; }