summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authoradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-10 00:24:51 +0100
committeradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-10 00:24:51 +0100
commit3be48a2d5a8988f5df8b8776a7d4d534871378b3 (patch)
tree863e9b13181b608817774492bb0a7269fdae0836 /source/cClientHandle.cpp
parentAdded m_IP to player class and binding to get IP for LUA. (Probably should use m_pState) (diff)
downloadcuberite-3be48a2d5a8988f5df8b8776a7d4d534871378b3.tar
cuberite-3be48a2d5a8988f5df8b8776a7d4d534871378b3.tar.gz
cuberite-3be48a2d5a8988f5df8b8776a7d4d534871378b3.tar.bz2
cuberite-3be48a2d5a8988f5df8b8776a7d4d534871378b3.tar.lz
cuberite-3be48a2d5a8988f5df8b8776a7d4d534871378b3.tar.xz
cuberite-3be48a2d5a8988f5df8b8776a7d4d534871378b3.tar.zst
cuberite-3be48a2d5a8988f5df8b8776a7d4d534871378b3.zip
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 4cc176db6..7ce7e38c0 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -59,7 +59,6 @@
#include "packets/cPacket_EntityEquipment.h"
#include "packets/cPacket_CreateInventoryAction.h"
#include "packets/cPacket_NewInvalidState.h"
-#include "packets/cPacket_Thunderbolt.h" //for testing.
#include "packets/cPacket_UseEntity.h"
#include "packets/cPacket_WindowClose.h"
#include "packets/cPacket_13.h"
@@ -693,17 +692,6 @@ void cClientHandle::HandlePacket( cPacket* a_Packet )
break;
case E_BLOCK_WORKBENCH:
{
- ////////////// For testing V
- cPacket_NewInvalidState RainPacket;
- RainPacket.m_Reason = 1; //begin rain
- cRoot::Get()->GetServer()->Broadcast( RainPacket );
- //also strike table with lightning for test purposes
- cPacket_Thunderbolt ThunderboltPacket;
- ThunderboltPacket.m_xLBPos = PacketData->m_PosX;
- ThunderboltPacket.m_yLBPos = PacketData->m_PosY;
- ThunderboltPacket.m_zLBPos = PacketData->m_PosZ;
- cRoot::Get()->GetServer()->Broadcast( ThunderboltPacket );
- ////////////// For testing ^
bPlaceBlock = false;
cWindow* Window = new cCraftingWindow( 0, true );
m_Player->OpenWindow( Window );
@@ -712,11 +700,6 @@ void cClientHandle::HandlePacket( cPacket* a_Packet )
case E_BLOCK_FURNACE:
case E_BLOCK_CHEST:
{
- ////////////// For testing V
- cPacket_NewInvalidState RainPacket;
- RainPacket.m_Reason = 2; //end rain
- cRoot::Get()->GetServer()->Broadcast( RainPacket );
- ////////////// For testing ^
bPlaceBlock = false;
cBlockEntity* BlockEntity = m_Player->GetWorld()->GetBlockEntity( PacketData->m_PosX, PacketData->m_PosY, PacketData->m_PosZ );
if( BlockEntity )
@@ -1091,6 +1074,13 @@ void cClientHandle::Tick(float a_Dt)
LoginResponse.m_Dimension = 0;
Send( LoginResponse );
+ // Send Weather if raining:
+ if ( (World->GetWeather() == 1) || (World->GetWeather() == 2) ) {
+ cPacket_NewInvalidState RainPacket;
+ RainPacket.m_Reason = 1; //begin rain
+ Send( RainPacket );
+ }
+
// Send position
Send( cPacket_PlayerMoveLook( m_Player ) );