From 3be48a2d5a8988f5df8b8776a7d4d534871378b3 Mon Sep 17 00:00:00 2001 From: "admin@omencraft.com" Date: Wed, 9 Nov 2011 23:24:51 +0000 Subject: Added random weather that persists per world. Also added SetWeather, GetWeather, and CastThunderbolt to lua bindings. git-svn-id: http://mc-server.googlecode.com/svn/trunk@83 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'source/cClientHandle.cpp') 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 ) ); -- cgit v1.2.3