|
@@ -159,7 +159,7 @@ void Spiel::setSpielerNummern( int anzahl, Array< int > * spielerNummern )
|
|
|
for( int j = 0; j < sts->teamAnzahl; j++ )
|
|
|
{
|
|
|
bis = von + ( sts->teamSize->hat( j ) ? sts->teamSize->get( j ) : 0 );
|
|
|
- if( tmp->getSpielerNummer() >= von && tmp->getSpielerNummer() < bis )
|
|
|
+ if( spielerNummern->get( i ) >= von && spielerNummern->get( i ) < bis )
|
|
|
{
|
|
|
team = j;
|
|
|
break;
|
|
@@ -540,18 +540,21 @@ void Spiel::tick( double zeit )
|
|
|
if( nextAsteroid <= 0 )
|
|
|
{
|
|
|
nextAsteroid += 30 + (float)randG.rand() * 30;
|
|
|
- Vertex pos = Vertex( (float)randG.rand() * (float)welt->getWorldInfo().size.x, (float)randG.rand() * (float)welt->getWorldInfo().size.y );
|
|
|
- Vertex speed = Vertex( (float)randG.rand() * 100, (float)randG.rand() * 100 );
|
|
|
- float rot = 2 * (float)PI * (float)randG.rand();
|
|
|
- float rotS = (float)randG.rand();
|
|
|
- int index = (int)( (float)asteroidModels->getEintragAnzahl() * (float)randG.rand() );
|
|
|
- Asteroid *astr = new Asteroid( asteroidId++, pos, speed, rot, rotS, asteroidModels->get( index ) );
|
|
|
- asteroids->add( astr );
|
|
|
- welt->addObject( astr->getThis() );
|
|
|
- for( int j = 0; j < spielerAnzahl; j++ )
|
|
|
+ if( asteroids->getEintragAnzahl() < 30 )
|
|
|
{
|
|
|
- if( spieler->z( j ) && spieler->z( j )->zKlient() )
|
|
|
- spieler->z( j )->zKlient()->sendeAsteroid( astr->getId(), pos, speed, rot, rotS, index, spielZeit );
|
|
|
+ Vertex pos = Vertex( (float)randG.rand() * (float)welt->getWorldInfo().size.x, (float)randG.rand() * (float)welt->getWorldInfo().size.y );
|
|
|
+ Vertex speed = Vertex( (float)randG.rand() * 100, (float)randG.rand() * 100 );
|
|
|
+ float rot = 2 * (float)PI * (float)randG.rand();
|
|
|
+ float rotS = (float)randG.rand();
|
|
|
+ int index = (int)( (float)asteroidModels->getEintragAnzahl() * (float)randG.rand() );
|
|
|
+ Asteroid *astr = new Asteroid( asteroidId++, pos, speed, rot, rotS, asteroidModels->get( index ) );
|
|
|
+ asteroids->add( astr );
|
|
|
+ welt->addObject( astr->getThis() );
|
|
|
+ for( int j = 0; j < spielerAnzahl; j++ )
|
|
|
+ {
|
|
|
+ if( spieler->z( j ) && spieler->z( j )->zKlient() )
|
|
|
+ spieler->z( j )->zKlient()->sendeAsteroid( astr->getId(), pos, speed, rot, rotS, index, spielZeit );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// Pixel
|