Fixes and bugtraps

This commit is contained in:
Dander7BD 2014-02-18 15:09:01 +01:00
parent 3218e7b847
commit 996f660990
2 changed files with 12 additions and 4 deletions

View File

@ -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( NetEvent<NetworkClient*, NetworkClient::ClientEven
}
C_DynamicObj *object = (*this->privData->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 */

View File

@ -101,13 +101,17 @@ void NetLoadState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientE
this->ChangeState( 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;