From 578560d2132188279e4b0930212edd915bc90008 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 1 Apr 2013 20:56:25 +0000 Subject: Proper fix for FS #347. Also unification of ticking block entities. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1348 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/FurnaceEntity.cpp | 46 +--------------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) (limited to 'source/FurnaceEntity.cpp') diff --git a/source/FurnaceEntity.cpp b/source/FurnaceEntity.cpp index d464749d8..f6727c555 100644 --- a/source/FurnaceEntity.cpp +++ b/source/FurnaceEntity.cpp @@ -280,51 +280,7 @@ void cFurnaceEntity::SetSlot(int a_Slot, const cItem & a_Item) -#define READ(File, Var) \ - if (File.Read(&Var, sizeof(Var)) != sizeof(Var)) \ - { \ - LOGERROR("ERROR READING cFurnaceEntity %s FROM FILE (line %d)", #Var, __LINE__); \ - return false; \ - } - -bool cFurnaceEntity::LoadFromFile(cFile & f) -{ - READ(f, m_PosX); - READ(f, m_PosY); - READ(f, m_PosZ); - - unsigned int NumSlots = 0; - READ(f, NumSlots); - m_Items = new cItem[ NumSlots ]; - for(unsigned int i = 0; i < NumSlots; i++) - { - cItem & Item = m_Items[i]; - READ(f, Item.m_ItemType); - READ(f, Item.m_ItemCount); - READ(f, Item.m_ItemDamage); - } - cItem CookingItem; - READ(f, CookingItem.m_ItemType); - READ(f, CookingItem.m_ItemCount); - READ(f, CookingItem.m_ItemDamage); - if (!CookingItem.IsEmpty()) - { - m_CookingItem = new cItem(CookingItem); - } - - READ(f, m_CookTime); - READ(f, m_TimeCooked); - READ(f, m_BurnTime); - READ(f, m_TimeBurned); - - return true; -} - - - - - -bool cFurnaceEntity::LoadFromJson( const Json::Value& a_Value ) +bool cFurnaceEntity::LoadFromJson(const Json::Value & a_Value) { m_PosX = a_Value.get("x", 0).asInt(); m_PosY = a_Value.get("y", 0).asInt(); -- cgit v1.2.3