From 013da806ec20b62a742aded9a9d2b8131193f30d Mon Sep 17 00:00:00 2001 From: jfhumann Date: Fri, 18 Apr 2014 21:09:44 +0200 Subject: Did some static analysis, fixed some bugs and optimized a lot of code --- src/BlockEntities/FurnaceEntity.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/BlockEntities/FurnaceEntity.cpp') diff --git a/src/BlockEntities/FurnaceEntity.cpp b/src/BlockEntities/FurnaceEntity.cpp index 7d6d1f89e..1b1741713 100644 --- a/src/BlockEntities/FurnaceEntity.cpp +++ b/src/BlockEntities/FurnaceEntity.cpp @@ -413,19 +413,20 @@ bool cFurnaceEntity::CanCookInputToOutput(void) const return false; } - if (m_Contents.GetSlot(fsOutput).IsEmpty()) + const cItem & Slot = m_Contents.GetSlot(fsOutput); + if (Slot.IsEmpty()) { // The output is empty, can cook return true; } - if (!m_Contents.GetSlot(fsOutput).IsEqual(*m_CurrentRecipe->Out)) + if (!Slot.IsEqual(*m_CurrentRecipe->Out)) { // The output slot is blocked with something that cannot be stacked with the recipe's output return false; } - if (m_Contents.GetSlot(fsOutput).IsFullStack()) + if (Slot.IsFullStack()) { // Cannot add any more items to the output slot return false; -- cgit v1.2.3