Browse Source

Spieler können jetzt inventarfelder aktivieren

Kolja Strohm 5 years ago
parent
commit
59751e59ae
1 changed files with 7 additions and 1 deletions
  1. 7 1
      StickmanWorldOnline/Spieler.cpp

+ 7 - 1
StickmanWorldOnline/Spieler.cpp

@@ -14,6 +14,9 @@
 
 
 Inventar::Inventar()
+    : slots(),
+    anzahl(),
+    abklingzeit()
 {
     for( int i = 0; i < INVENTORY_SLOTS; i++ )
     {
@@ -168,7 +171,8 @@ float Inventar::getAbklingzeit( int index ) const
 
 
 Spieler::Spieler( ResourceRegistry *zResources, int id, Team *team, int spawnX, int spawnY, int farbe )
-    : GameObject( SPIELER, spawnX, spawnY, 40, 50 )
+    : GameObject( SPIELER, spawnX, spawnY, 40, 50 ),
+    tastenStand()
 {
     accountId = 0;
     spielerNummer = id;
@@ -271,6 +275,8 @@ bool Spieler::setTastenStand( unsigned char taste, bool pressed )
             current = resources->getResource( R_SPIELER_RECHTS, color );
             ausrichtung = RECHTS;
         }
+        if( taste >= '1' && taste <= '8' )
+            inv.setSelected( taste - '1' );
     }
     else
     {