[Orxonox-commit 2098] r6814 - in code/branches/rocket: data/levels/includes src/modules/weapons src/modules/weapons/weaponmodes
gnadler at orxonox.net
gnadler at orxonox.net
Sat May 1 18:15:41 CEST 2010
Author: gnadler
Date: 2010-05-01 18:15:40 +0200 (Sat, 01 May 2010)
New Revision: 6814
Modified:
code/branches/rocket/data/levels/includes/weaponsettings3.oxi
code/branches/rocket/src/modules/weapons/RocketController.cc
code/branches/rocket/src/modules/weapons/RocketController.h
code/branches/rocket/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
Log:
tried to fix ~RocketController() as well as that the rocket is not visible, but failed
Modified: code/branches/rocket/data/levels/includes/weaponsettings3.oxi
===================================================================
--- code/branches/rocket/data/levels/includes/weaponsettings3.oxi 2010-05-01 10:37:53 UTC (rev 6813)
+++ code/branches/rocket/data/levels/includes/weaponsettings3.oxi 2010-05-01 16:15:40 UTC (rev 6814)
@@ -38,7 +38,7 @@
<LightningGun mode=1 muzzleoffset="0,0,0" />
</Weapon>
<Weapon>
- <SimpleRocketFire mode=2 muzzleoffset="5,5,5" />
+ <SimpleRocketFire mode=2 muzzleoffset="0,0,0" />
</Weapon>
</WeaponPack>
<WeaponPack>
Modified: code/branches/rocket/src/modules/weapons/RocketController.cc
===================================================================
--- code/branches/rocket/src/modules/weapons/RocketController.cc 2010-05-01 10:37:53 UTC (rev 6813)
+++ code/branches/rocket/src/modules/weapons/RocketController.cc 2010-05-01 16:15:40 UTC (rev 6814)
@@ -66,9 +66,13 @@
}
- /*
- I wanted to define the controllable entity with this function but the compiler gives the error: line 80: rocket - unidentified identifier
- or some similar error.
- */
+ RocketController::~RocketController() {
+
+ delete this->getControllableEntity();
+
+ }
+
+
+
}
Modified: code/branches/rocket/src/modules/weapons/RocketController.h
===================================================================
--- code/branches/rocket/src/modules/weapons/RocketController.h 2010-05-01 10:37:53 UTC (rev 6813)
+++ code/branches/rocket/src/modules/weapons/RocketController.h 2010-05-01 16:15:40 UTC (rev 6814)
@@ -47,7 +47,7 @@
{
public:
RocketController(BaseObject* creator);
- virtual ~RocketController(){};
+ virtual ~RocketController();
virtual void tick(float dt);
protected:
Modified: code/branches/rocket/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
===================================================================
--- code/branches/rocket/src/modules/weapons/weaponmodes/SimpleRocketFire.cc 2010-05-01 10:37:53 UTC (rev 6813)
+++ code/branches/rocket/src/modules/weapons/weaponmodes/SimpleRocketFire.cc 2010-05-01 16:15:40 UTC (rev 6814)
@@ -64,10 +64,10 @@
RocketController* con = new RocketController(this);
- /* this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
- rocket->setOrientation(this->getMuzzleOrientation());
- rocket->setPosition(this->getMuzzlePosition());
- rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
+ this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
+ con->getControllableEntity()->setOrientation(this->getMuzzleOrientation());
+ con->getControllableEntity()->setPosition(this->getMuzzlePosition());
+ /* rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
rocket->scale(2);
rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
More information about the Orxonox-commit
mailing list