diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-09-01 21:05:45 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-09-01 21:05:45 +0200 |
commit | dfed6f94ca78f2e104ed316d83400b0ca74cb79a (patch) | |
tree | d00547328b70bbb4a4ea5d713f6ffe8e3a48ee12 /src/Mobs/Monster.cpp | |
parent | Added CustomName to cMonster. (diff) | |
download | cuberite-dfed6f94ca78f2e104ed316d83400b0ca74cb79a.tar cuberite-dfed6f94ca78f2e104ed316d83400b0ca74cb79a.tar.gz cuberite-dfed6f94ca78f2e104ed316d83400b0ca74cb79a.tar.bz2 cuberite-dfed6f94ca78f2e104ed316d83400b0ca74cb79a.tar.lz cuberite-dfed6f94ca78f2e104ed316d83400b0ca74cb79a.tar.xz cuberite-dfed6f94ca78f2e104ed316d83400b0ca74cb79a.tar.zst cuberite-dfed6f94ca78f2e104ed316d83400b0ca74cb79a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Monster.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 6a477ca1c..a89fa32a3 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -553,6 +553,25 @@ void cMonster::KilledBy(TakeDamageInfo & a_TDI) +void cMonster::OnRightClicked(cPlayer & a_Player) +{ + super::OnRightClicked(a_Player); + + const cItem & EquippedItem = a_Player.GetEquippedItem(); + if ((EquippedItem.m_ItemType == E_ITEM_NAME_TAG) && !EquippedItem.m_CustomName.empty()) + { + SetCustomName(EquippedItem.m_CustomName); + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } +} + + + + + // Checks to see if EventSeePlayer should be fired // monster sez: Do I see the player void cMonster::CheckEventSeePlayer(void) |