Ver Fonte

Fehler im Enterhaken behoben

Kolja Strohm há 5 anos atrás
pai
commit
1ab170531f
1 ficheiros alterados com 4 adições e 4 exclusões
  1. 4 4
      StickmanWorldOnline/Enterhaken.cpp

+ 4 - 4
StickmanWorldOnline/Enterhaken.cpp

@@ -90,14 +90,14 @@ bool EnterhakenEffect::tick( double time, Spiel * zSpiel )
         }
         for( auto s = zSpiel->getSpieler(); s; s++ )
         {
-            if( s->zTeam() != zSpieler->zTeam() && s->getX() <= ehpx - 10 && s->getX() + s->getWidth() > ehpx + 10 && s->getY() <= ehpy - 10 && s->getY() + s->getWidth() > ehpy + 10 )
+            if( s->zTeam() != zSpieler->zTeam() && s->getX() <= ehpx - 10 && s->getX() + s->getWidth() > ehpx + 10 && s->getY() <= ehpy - 10 && s->getY() + s->getHeight() > ehpy + 10 )
                 s->nimmSchaden( 150 * (float)time, zSpieler, r, zSpiel );
         }
         for( auto b = zSpiel->getBarieren(); b; b++ )
         {
             if( b->hatStyle( Bariere::Style::Aktiv ) && (!b->zTeam() || b->zTeam() == zSpieler->zTeam()) )
             {
-                if( b->getX() <= ehpx - 10 && b->getX() + b->getWidth() > ehpx + 10 && b->getY() <= ehpy - 10 && b->getY() + b->getWidth() > ehpy + 10 )
+                if( b->getX() <= ehpx - 10 && b->getX() + b->getWidth() > ehpx + 10 && b->getY() <= ehpy - 10 && b->getY() + b->getHeight() > ehpy + 10 )
                 {
                     target = b;
                     state = 2;
@@ -125,7 +125,7 @@ bool EnterhakenEffect::tick( double time, Spiel * zSpiel )
         }
         for( auto s = zSpiel->getSpieler(); s; s++ )
         {
-            if( s->zTeam() != zSpieler->zTeam() && s->getX() <= ehpx - 10 && s->getX() + s->getWidth() > ehpx + 10 && s->getY() <= ehpy - 10 && s->getY() + s->getWidth() > ehpy + 10 )
+            if( s->zTeam() != zSpieler->zTeam() && s->getX() <= ehpx - 10 && s->getX() + s->getWidth() > ehpx + 10 && s->getY() <= ehpy - 10 && s->getY() + s->getHeight() > ehpy + 10 )
                 s->nimmSchaden( 150 * (float)time, zSpieler, invert( r ), zSpiel );
         }
         timeLeft -= (float)time;
@@ -150,7 +150,7 @@ bool EnterhakenEffect::tick( double time, Spiel * zSpiel )
         default:
             break;
         }
-        if( !target->hatStyle( Bariere::Style::Aktiv ) || target->getX() > ehpx - 10 || target->getX() + target->getWidth() <= ehpx + 10 || target->getY() > ehpy - 10 || target->getY() + target->getWidth() <= ehpy + 10 )
+        if( !target->hatStyle( Bariere::Style::Aktiv ) || target->getX() > ehpx - 10 || target->getX() + target->getWidth() <= ehpx + 10 || target->getY() > ehpy - 10 || target->getY() + target->getHeight() <= ehpy + 10 )
             state = 3;
     }
     return state == 5;