|
@@ -7,7 +7,8 @@
|
|
|
|
|
|
|
|
|
Player::Player()
|
|
|
- : Entity( PlayerEntityType::INSTANCE, 1 )
|
|
|
+ : Entity( PlayerEntityType::INSTANCE, 1 ),
|
|
|
+ leftHandPosition( 0 )
|
|
|
{
|
|
|
setModelDaten( window->zBildschirm()->zGraphicsApi()->getModel( "player" ) );
|
|
|
Bild* b = new Bild();
|
|
@@ -64,7 +65,7 @@ bool Player::tick( double time )
|
|
|
currentGame->setTarget( 0 );
|
|
|
((Game*)(Menu*)menuRegister->get( "game" ))->updatePosition( pos, 0, { 0, 0, 0 } );
|
|
|
}
|
|
|
- ((Game*)(Menu*)menuRegister->get( "game" ))->updateInventory( itemBar, 0 ); // todo: pass selected slot
|
|
|
+ ((Game*)(Menu*)menuRegister->get( "game" ))->updateInventory( itemBar, leftHandPosition );
|
|
|
}
|
|
|
cs.unlock();
|
|
|
return Entity::tick( time );
|
|
@@ -77,6 +78,10 @@ PlayerEntityType::PlayerEntityType()
|
|
|
|
|
|
void PlayerEntityType::loadSuperEntity( Entity* zEntity, Framework::StreamReader* zReader ) const
|
|
|
{
|
|
|
+ Player* zPlayer = dynamic_cast<Player*>(zEntity);
|
|
|
+ if( !zPlayer )
|
|
|
+ throw "PlayerEntityType::loadSuperEntity was called with an entity witch is not an instance of Player";
|
|
|
+ zReader->lese( (char*)&zPlayer->leftHandPosition, 4 );
|
|
|
EntityType::loadSuperEntity( zEntity, zReader );
|
|
|
}
|
|
|
|