|
@@ -28,6 +28,10 @@ Base::~Base()
|
|
|
|
|
|
void Base::setTeam( Team *team, Spiel *zSpiel )
|
|
|
{
|
|
|
+ Ereignis *e = new Ereignis( BASIS_BESITZERWECHSEL );
|
|
|
+ e->addParameter( "Betroffene Basis", getThis() );
|
|
|
+ e->addParameter( "Vorheriges Team", this->team ? this->team->getThis() : new Variable( NICHTS ) );
|
|
|
+ e->addParameter( "Nächstes Team", team ? team->getThis() : new Variable( NICHTS ) );
|
|
|
if( this->team )
|
|
|
this->team->release();
|
|
|
this->team = team;
|
|
@@ -35,6 +39,7 @@ void Base::setTeam( Team *team, Spiel *zSpiel )
|
|
|
textur->release();
|
|
|
textur = resources->zResource( R_BASE, team ? team->getFarbe() : 0 )->getImages()->getThis();
|
|
|
zSpiel->setLastTeamChangedBase( (Base *)getThis() );
|
|
|
+ zSpiel->throwEvent( e );
|
|
|
}
|
|
|
|
|
|
void Base::startChange( Team *team )
|
|
@@ -72,14 +77,8 @@ void Base::tick( double time, Spiel *zSpiel )
|
|
|
leftTime -= (float)time;
|
|
|
if( leftTime <= 0 )
|
|
|
{
|
|
|
- Ereignis *e = new Ereignis( BASIS_BESITZERWECHSEL );
|
|
|
- e->addParameter( "Betroffene Basis", getThis() );
|
|
|
- e->addParameter( "Vorheriges Team", team ? team->getThis() : new Variable( NICHTS ) );
|
|
|
- e->addParameter( "Nächstes Team", nextTeam ? nextTeam->getThis() : new Variable( NICHTS ) );
|
|
|
- zSpiel->throwEvent( e );
|
|
|
- if( team )
|
|
|
- team->release();
|
|
|
- team = nextTeam;
|
|
|
+ setTeam( nextTeam, zSpiel );
|
|
|
+ nextTeam = 0;
|
|
|
inChange = 0;
|
|
|
}
|
|
|
}
|