From 996f66099054910769a7a2cbff25132055bbdd9a Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Tue, 18 Feb 2014 15:09:01 +0100 Subject: [PATCH] Fixes and bugtraps --- Code/Game/GameClient/GameClientState/GameState.cpp | 10 +++++++--- Code/Game/GameClient/GameClientState/NetLoadState.cpp | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Code/Game/GameClient/GameClientState/GameState.cpp b/Code/Game/GameClient/GameClientState/GameState.cpp index 7118191e..3576ae65 100644 --- a/Code/Game/GameClient/GameClientState/GameState.cpp +++ b/Code/Game/GameClient/GameClientState/GameState.cpp @@ -146,7 +146,8 @@ bool GameState::Render() auto dynamicObject = this->privData->dynamicObjects->begin(); for( ; dynamicObject != this->privData->dynamicObjects->end(); ++dynamicObject ) { - dynamicObject->second->Render(); + if( dynamicObject->second ) + dynamicObject->second->Render(); } Oyster::Graphics::API::EndFrame(); @@ -366,8 +367,11 @@ void GameState::DataRecieved( NetEventprivData->dynamicObjects)[decoded.object_ID]; - object->setPos( position ); - object->setRot( rotation ); + if( object ) + { + object->setPos( position ); + object->setRot( rotation ); + } } break; case protocol_Gameplay_ObjectEnabled: break; /** @todo TODO: implement */ diff --git a/Code/Game/GameClient/GameClientState/NetLoadState.cpp b/Code/Game/GameClient/GameClientState/NetLoadState.cpp index d120cac2..9a88072c 100644 --- a/Code/Game/GameClient/GameClientState/NetLoadState.cpp +++ b/Code/Game/GameClient/GameClientState/NetLoadState.cpp @@ -101,13 +101,17 @@ void NetLoadState::DataRecieved( NetEventChangeState( ClientState_Game ); this->privData->loading = false; } + else + { // HACK: Debug trap + const char *breakPoint = "Being greedy."; + } } void NetLoadState::LoadGame( const ::std::string &fileName ) { this->privData->loading = true; - LevelLoader loader; + LevelLoader loader( "..\\Content\\Worlds\\" ); auto objects = loader.LoadLevel( fileName ); auto object = objects.begin(); ObjectTypeHeader *oth;