[Orxonox-commit 4946] r9615 - in code/branches/formationupdate: data/levels src/orxonox/worldentities/pawns
maxima at orxonox.net
maxima at orxonox.net
Tue Apr 23 13:42:54 CEST 2013
Author: maxima
Date: 2013-04-23 13:42:53 +0200 (Tue, 23 Apr 2013)
New Revision: 9615
Modified:
code/branches/formationupdate/data/levels/maxim.oxw
code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc
Log:
If the HumanController dies but had slaves,
then the Controller changes to one of his slaves
Modified: code/branches/formationupdate/data/levels/maxim.oxw
===================================================================
--- code/branches/formationupdate/data/levels/maxim.oxw 2013-04-09 14:02:46 UTC (rev 9614)
+++ code/branches/formationupdate/data/levels/maxim.oxw 2013-04-23 11:42:53 UTC (rev 9615)
@@ -64,9 +64,9 @@
<!-- ADDING FORMATION: 5 Swallows -->
- <?lua for i=0,4,1 do
+ <?lua for i=0,1,1 do
?>
- <SpaceShip position="<?lua print(400+i*200) ?>,-200,1000" lookat="-1300,-600,900" visible="true">
+ <SpaceShip position="<?lua print(800+i*200) ?>,700,600" lookat="-1300,-600,900" visible="true">
<templates>
<Template link=spaceshipswallow />
</templates>
@@ -78,8 +78,8 @@
<!-- ADDING ENEMY FORMATION: 5 Swallows -->
- <!--
- <?lua for i=0,4,1 do
+
+ <?lua for i=0,1,1 do
?>
<SpaceShip position="<?lua print(5000+i*200) ?>,-200,1000" lookat="-1300,-600,900" visible="true">
<templates>
@@ -90,7 +90,6 @@
</controller>
</SpaceShip>
<?lua end ?>
- -->
</Scene>
</Level>
Modified: code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc 2013-04-09 14:02:46 UTC (rev 9614)
+++ code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc 2013-04-23 11:42:53 UTC (rev 9615)
@@ -324,6 +324,7 @@
return true;
}
}
+ orxout(user_warning) << "The HumanController has no slaves!" << endl;
return false;
}
@@ -358,12 +359,14 @@
/* Do different things if Pawn is the Master of a Formation
* Doesn't work yet
*
- * if(this->hasSlaves())
+ */ if(this->hasSlaves())
{
// start to control a slave
this->getPlayer()->startControl(this->getSlave()->getControllableEntity());
- }*/
- this->getPlayer()->stopControl();
+ }
+ else{
+ this->getPlayer()->stopControl();
+ }
}
if (GameMode::isMaster())
{
More information about the Orxonox-commit
mailing list