From 674fe1e955f729e8328772313c45fe76857ec835 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 19 Aug 2012 21:14:45 +0000 Subject: Window, Chest, Furnace and Pawn are not using cPackets at all git-svn-id: http://mc-server.googlecode.com/svn/trunk@762 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cFurnaceEntity.cpp | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'source/cFurnaceEntity.cpp') diff --git a/source/cFurnaceEntity.cpp b/source/cFurnaceEntity.cpp index 2373b3555..4b3c1d04e 100644 --- a/source/cFurnaceEntity.cpp +++ b/source/cFurnaceEntity.cpp @@ -12,9 +12,6 @@ #include "cServer.h" #include "cPickup.h" #include "cRoot.h" - -#include "packets/cPacket_InventoryProgressBar.h" - #include @@ -146,13 +143,10 @@ bool cFurnaceEntity::Tick( float a_Dt ) cWindow * Window = GetWindow(); if (Window != NULL) { - cPacket_InventoryProgressBar Progress; - Progress.m_ProgressBar = 0; - Progress.m_WindowID = (char)Window->GetWindowID(); - Progress.m_Value = (short)( m_TimeCooked * (180.f / m_CookTime) ); - if (Progress.m_Value > 180) Progress.m_Value = 180; - if (Progress.m_Value < 0) Progress.m_Value = 0; - Window->Broadcast(Progress); + short Value = (short)( m_TimeCooked * (180.f / m_CookTime)); + if (Value > 180) Value = 180; + if (Value < 0) Value = 0; + Window->BroadcastInventoryProgress(0, Value); } } } @@ -171,21 +165,14 @@ bool cFurnaceEntity::Tick( float a_Dt ) } if (Window != NULL) { - cPacket_InventoryProgressBar Progress; - Progress.m_WindowID = (char)Window->GetWindowID(); - Progress.m_ProgressBar = 1; - + short Value = 0; if (m_BurnTime > 0.f) { - Progress.m_Value = 250 - (short)( m_TimeBurned * (250.f / m_BurnTime) ); - if (Progress.m_Value > 250) Progress.m_Value = 250; - if (Progress.m_Value < 0) Progress.m_Value = 0; - } - else - { - Progress.m_Value = 0; + Value = 250 - (short)( m_TimeBurned * (250.f / m_BurnTime)); + if (Value > 250) Value = 250; + if (Value < 0) Value = 0; } - Window->Broadcast(Progress); + Window->BroadcastInventoryProgress(1, Value); } return ((m_CookingItem != NULL) || (m_TimeBurned < m_BurnTime)) && (m_BurnTime > 0.0); // Keep on ticking, if there's more to cook, or if it's cooking } -- cgit v1.2.3