Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8315 in orxonox.OLD


Ignore:
Timestamp:
Jun 11, 2006, 1:01:26 PM (18 years ago)
Author:
bensch
Message:

trunk: fixed a nasty seg-fault, when unloading the WeaponManager

@chrigi: do not doulbe-delete :) no, you could not have known

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/animation/t_animation.h

    r8145 r8315  
    316316{
    317317  return this->linear(timePassed);
    318 
    319318}
    320319
     
    338337float tAnimation<T>::quadratic(float timePassed) const
    339338{
    340   this->linear(timePassed);
     339  return this->linear(timePassed);
    341340}
    342341
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r8147 r8315  
    2222#include "weapon.h"
    2323#include "crosshair.h"
     24#include "class_list.h"
    2425
    2526#include "playable.h"
     
    3031#include "t_animation.h"
    3132
    32 using namespace std;
    33 
    3433
    3534/**
     
    5655  // crosshair being a PNode it must not be deleted (this is because PNodes delete themselves.)
    5756  // rennerc: crosshair seems not to delete itselve
    58   delete this->crosshair;
     57  if (ClassList::exists(this->crosshair, CL_CROSSHAIR))
     58    delete this->crosshair;
    5959}
    6060
     
    101101  this->currentConfigID = 0;
    102102  this->slotCount = 2;
    103   this->weaponChange;
     103  //this->weaponChange;
    104104
    105105  // CROSSHAIR INITIALISATION
     
    141141  LOAD_PARAM_START_CYCLE(root, element);
    142142
    143   Weapon* newWeapon = dynamic_cast<Weapon*>(Factory::fabricate(element));
    144   /// @todo implement this !!
    145 
    146 
     143  BaseObject* object = Factory::fabricate(element);
     144  if (object != NULL)
     145  {
     146    Weapon* newWeapon = dynamic_cast<Weapon*>(object);
     147    if (newWeapon == NULL)
     148      delete object;
     149  }
    147150  LOAD_PARAM_END_CYCLE(element);
    148151}
     
    464467void WeaponManager::draw() const
    465468{
     469  assert(false || "must not be called");
    466470  Weapon* drawWeapon;
    467471  for (int i = 0; i < this->slotCount; i++)
Note: See TracChangeset for help on using the changeset viewer.