Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 23, 2005, 11:17:27 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ProjectileFactory now handled in Weapon-class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/weapon.cc

    r4934 r4947  
    8080  this->emissionPoint.setParent(this);
    8181
    82   this->projectile = NULL;
     82  this->projectile = CL_NULL;
     83  this->projectileFactory = NULL;
    8384
    8485  this->hideInactive = true;
     
    9394}
    9495
     96/**
     97 * sets the Projectile to use for this weapon.
     98 * @param projectile The ID of the Projectile to use
     99 *
     100 * be aware, that this function does not create Factories, as this is job of Bullet-classes.
     101 */
     102bool Weapon::setProjectile(ClassID projectile)
     103{
     104  if (projectile == CL_NULL)
     105    return false;
     106  this->projectile = projectile;
     107  this->projectileFactory = FastFactory::searchFastFactory(projectile);
     108  if (this->projectileFactory == NULL)
     109    return false;
     110};
    95111
    96112/**
     
    446462  bool retVal = true;
    447463
    448   if (this->projectile == NULL)
     464//  if (this->projectile == NULL)
    449465  {
    450466    PRINTF(2)("There was no projectile assigned to the Weapon.\n");
Note: See TracChangeset for help on using the changeset viewer.