Changeset 4972 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/weapon.cc
- Timestamp:
- Aug 7, 2005, 10:32:23 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon.cc
r4967 r4972 96 96 } 97 97 98 void Weapon::loadParams(const TiXmlElement* root) 99 { 100 static_cast<WorldEntity*>(this)->loadParams(root); 101 102 LoadParam<Weapon>(root, "projectile", this, &Weapon::setProjectile) 103 .describe("Sets the name of the Projectile to load onto the Entity"); 104 105 LoadParam<Weapon>(root, "emission-point", this, &Weapon::setEmissionPoint) 106 .describe("Sets the Point of emission of this weapon"); 107 108 LoadParam<Weapon>(root, "state-duration", this, &Weapon::setStateDuration) 109 .describe("Sets the duration of a given state (1: state-Name; 2: duration in seconds)"); 110 111 LoadParam<Weapon>(root, "action-sound", this, &Weapon::setActionSound) 112 .describe("Sets a given sound to an action (1: action-Name; 2: name of the sound (relative to the Data-Path))"); 113 } 114 98 115 /** 99 116 * sets the Projectile to use for this weapon. … … 103 120 * be aware, that this function does not create Factories, as this is job of Bullet-classes. 104 121 */ 105 boolWeapon::setProjectile(ClassID projectile)122 void Weapon::setProjectile(ClassID projectile) 106 123 { 107 124 if (projectile == CL_NULL) 108 return false;125 return; 109 126 this->projectile = projectile; 110 127 this->projectileFactory = FastFactory::searchFastFactory(projectile); 111 128 if (this->projectileFactory == NULL) 112 return false;129 return; 113 130 else 114 131 { … … 125 142 * @see bool Weapon::setProjectile(ClassID projectile) 126 143 * @param projectile the Name of the Projectile. 127 * @return true if 128 */ 129 bool Weapon::setProjectile(const char* projectile) 144 */ 145 void Weapon::setProjectile(const char* projectile) 130 146 { 131 147 if (projectile == NULL) 132 return false;148 return; 133 149 FastFactory* tmpFac = FastFactory::searchFastFactory(projectile); 134 150 if (tmpFac != NULL) 135 151 { 136 152 this->setProjectile(tmpFac->getStoredID()); 153 } 154 else 155 { 156 PRINTF(2)("Projectile %s does not exist for weapon %s\n", projectile, this->getName()); 137 157 } 138 158 }
Note: See TracChangeset
for help on using the changeset viewer.