From f9008a4860dc9af9ca2e2ceb643064745269dcec Mon Sep 17 00:00:00 2001 From: Gargaj Date: Tue, 1 Dec 2015 23:12:44 +0100 Subject: allow use failures to propagate from the entity/block to the player --- src/BlockEntities/JukeboxEntity.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/BlockEntities/JukeboxEntity.cpp') diff --git a/src/BlockEntities/JukeboxEntity.cpp b/src/BlockEntities/JukeboxEntity.cpp index 1f3f4f324..467a3a28a 100644 --- a/src/BlockEntities/JukeboxEntity.cpp +++ b/src/BlockEntities/JukeboxEntity.cpp @@ -28,11 +28,12 @@ cJukeboxEntity::~cJukeboxEntity() -void cJukeboxEntity::UsedBy(cPlayer * a_Player) +bool cJukeboxEntity::UsedBy(cPlayer * a_Player) { if (IsPlayingRecord()) { EjectRecord(); + return true; } else { @@ -40,8 +41,10 @@ void cJukeboxEntity::UsedBy(cPlayer * a_Player) if (PlayRecord(HeldItem.m_ItemType)) { a_Player->GetInventory().RemoveOneEquippedItem(); + return true; } } + return false; } -- cgit v1.2.3