Changeset 10708 in orxonox.OLD for branches/presentation/src/world_entities/npcs
- Timestamp:
- Jun 16, 2007, 11:15:39 AM (17 years ago)
- Location:
- branches/presentation/src/world_entities/npcs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/npcs/adm_turret.cc
r10704 r10708 242 242 void AdmTurret::addCannons( const TiXmlElement * root ) 243 243 { 244 this->cannons = new WorldEntity();244 this->cannons = new DamageForwardingWorldEntity( this ); 245 245 this->cannons->setParent(this); 246 246 this->cannons->loadParams( root ); … … 250 250 251 251 this->cannons->toList( getOMListNumber() ); 252 this->cannons->setForwardDamageToParent( true ); 252 253 } 253 254 … … 260 261 //this->weapon->setAbsCoor( this->cannons->getAbsCoor() ); 261 262 this->weapon->setAbsDir( this->weapon->getAbsDir() * Quaternion( PI, Vector(0, 1, 0) ) ); 263 264 this->weapon->setForwardDamageToParent( true ); 262 265 } 263 266 264 267 void AdmTurret::addSensor( const TiXmlElement * root ) 265 268 { 266 this->sensor = new WorldEntity();269 this->sensor = new DamageForwardingWorldEntity( this ); 267 270 this->sensor->setParent(this); 268 271 this->sensor->loadParams( root ); … … 270 273 //this->sensor->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 271 274 //this->sensor->addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE); 272 this->sensor->toList( getOMListNumber() );275 273 276 } 274 277 -
branches/presentation/src/world_entities/npcs/adm_turret.h
r10703 r10708 12 12 #include "world_entity.h" 13 13 #include "weapons/bsp_weapon.h" 14 15 class DamageForwardingWorldEntity: public WorldEntity 16 { 17 public: 18 DamageForwardingWorldEntity( WorldEntity* dfp ){ this->damPar = dfp; } 19 virtual void hit(float damage, WorldEntity* killer){ this->damPar->hit(damage, killer); } 20 private: 21 WorldEntity* damPar; 22 }; 14 23 15 24
Note: See TracChangeset
for help on using the changeset viewer.