Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4979 in orxonox.OLD for orxonox/trunk/src/world_entities


Ignore:
Timestamp:
Aug 10, 2005, 4:47:23 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Objects now get cleanly ereased.
This is a fix in the Weapon-class, that kills the Resurected Projectiles created for information-gathering

Location:
orxonox/trunk/src/world_entities/weapons
Files:
3 edited

Legend:

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

    r4955 r4979  
    3939  this->lifeCycle = 0.0;
    4040  this->lifeSpan = 0.75f; /* sec */
     41
     42  this->remove();
    4143}
    4244
  • orxonox/trunk/src/world_entities/weapons/test_gun.cc

    r4974 r4979  
    3333#include "animation3d.h"
    3434#include "sound_engine.h"
     35
     36#include "null_parent.h"
    3537
    3638#include "fast_factory.h"
     
    175177  Projectile* pj =  dynamic_cast<Projectile*>(this->getProjectileFactory()->resurrect());
    176178
     179  pj->setParent(NullParent::getInstance());
    177180/*
    178181  PNode* target = this->getWeaponManager()->getFixedTarget();
  • orxonox/trunk/src/world_entities/weapons/weapon.cc

    r4972 r4979  
    127127  this->projectileFactory = FastFactory::searchFastFactory(projectile);
    128128  if (this->projectileFactory == NULL)
     129  {
     130    PRINTF(1)("unable to find FastFactory for the Projectile.\n");
    129131    return;
     132  }
    130133  else
    131134  {
    132135    // grabbing Parameters from the Projectile to have them at hand here.
    133     this->projectileFactory->prepare(1);
    134136    Projectile* pj = dynamic_cast<Projectile*>(this->projectileFactory->resurrect());
    135137    this->minCharge = pj->getEnergyMin();
    136138    this->maxCharge = pj->getEnergyMax();
    137139    this->chargeable = pj->isChageable();
    138   }
    139 };
     140    this->projectileFactory->kill(pj);
     141  }
     142}
    140143
    141144/**
Note: See TracChangeset for help on using the changeset viewer.