Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4894 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jul 19, 2005, 5:27:30 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: seg-fault prevention thanks to the ClassList.
The animations will only be deleted, if they are in the ClassList stored as animations.
PS: commiting this out of the Kdevelop-svn-environment, and it totally rocks.
@patrick: switching payed out :)

File:
1 edited

Legend:

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

    r4893 r4894  
    2323#include "projectile.h"
    2424
     25#include "class_list.h"
    2526#include "load_param.h"
    2627#include "vector.h"
     
    5354{
    5455  for (int i = 0; i < WS_STATE_COUNT; i++)
    55     if (this->animation[i])
     56    if (this->animation[i] && ClassList::exists(animation[i], CL_ANIMATION))  //!< @todo this should check animation3D
    5657      delete this->animation[i];
    5758  for (int i = 0; i < WA_ACTION_COUNT; i++)
     
    216217  {
    217218    case WA_SHOOT:
    218       this->fireW();
     219      return this->fireW();
    219220      break;
    220221    case WA_CHARGE:
    221       this->chargeW();
     222      return this->chargeW();
    222223      break;
    223224    case WA_RELOAD:
    224       this->reloadW();
     225      return this->reloadW();
    225226      break;
    226227    case WA_DEACTIVATE:
    227       this->deactivateW();
     228      return this->deactivateW();
    228229      break;
    229230    case WA_ACTIVATE:
    230       this->activateW();
    231       break;
    232   }
    233 }
    234 
    235 
    236 /**
    237  *
    238  * @return
     231      return this->activateW();
     232      break;
     233  }
     234}
     235
     236
     237/**
     238 * checks and activates the Weapon.
     239 * @return true on success.
    239240 */
    240241bool Weapon::activateW()
     
    259260
    260261/**
    261  *
    262  * @return
     262 * checks and deactivates the Weapon
     263 * @return true on success.
    263264 */
    264265bool Weapon::deactivateW()
     
    282283
    283284/**
    284  *
    285  * @return
     285 * checks and charges the Weapon
     286 * @return true on success.
    286287 */
    287288bool Weapon::chargeW()
     
    310311
    311312/**
    312  *
    313  * @return
     313 * checks and fires the Weapon
     314 * @return true on success.
    314315 */
    315316bool Weapon::fireW()
     
    339340
    340341/**
    341  *
    342  * @return
     342 * checks and Reloads the Weapon
     343 * @return true on success.
    343344 */
    344345bool Weapon::reloadW()
Note: See TracChangeset for help on using the changeset viewer.