Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 18, 2006, 3:00:56 PM (18 years ago)
Author:
bensch
Message:

trunk: WeaponManager update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r6512 r6561  
    2222#include "weapon.h"
    2323#include "crosshair.h"
     24
     25#include "playable.h"
    2426
    2527#include "load_param.h"
     
    213215 * a error message.
    214216 */
    215 void WeaponManager::addWeapon(Weapon* weapon, int configID, int slotID)
     217bool WeaponManager::addWeapon(Weapon* weapon, int configID, int slotID)
    216218{
    217219  if (unlikely(configID >= WM_MAX_CONFIGS || slotID >= (int)this->slotCount))
    218220  {
    219221    PRINTF(2)("Slot %d of config %d is not availiabe (max: %d)\n", slotID, configID, this->slotCount);
    220     return;
     222    return false;
    221223  }
    222224
     
    230232    {
    231233      PRINTF(1)("There is no free slot in this WeaponConfig to dock this weapon at! Aborting\n");
    232       return;
     234      return false;
    233235    }
    234236  }
     
    239241    PRINTF(2)("Unable to add Weapon with wrong capatibility to Slot %d (W:%d M:%d)\n",
    240242              slotID, weapon->getCapability(), this->currentSlotConfig[slotID].capability);
    241     return;
     243    return false;
    242244  }
    243245
     
    249251  }
    250252  PRINTF(3)("Added a new Weapon to the WeaponManager: config %i/ slot %i\n", configID, slotID);
     253  return true;
    251254}
    252255
Note: See TracChangeset for help on using the changeset viewer.