Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2006, 10:44:37 AM (17 years ago)
Author:
patrick
Message:

mount point interaction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mount_points/src/world_entities/world_entity.cc

    r10057 r10058  
    2424#include "md2/md2Model.h"
    2525#include "md3/md3_model.h"
     26
    2627#include "oif/object_information_file.h"
     28#include "mount_point.h"
    2729
    2830#include "aabb_tree_node.h"
     
    334336  if( this->mountPoints[slot] != NULL)
    335337  {
    336     PRINTF(0)("adding a mount point to a slot, that already exists! ignoring - maybe some object do not get connected well (object: %s)", this->getClassCName());
     338    PRINTF(0)("adding a mount point to a slot, that already exists! ignoring - maybe some object do not get connected well (object: %s)\n", this->getClassCName());
    337339  }
    338340
     
    348350void WorldEntity::mount(int slot, WorldEntity* entity)
    349351{
    350 
     352  if( this->mountPoints[slot] == NULL)
     353  {
     354    PRINTF(0)("you tried to add an entity to a mount point that doesn't exist (slot %i)\n", slot);
     355    return;
     356  }
     357
     358  // mount the entity
     359  this->mountPoints[slot]->mount(entity);
    351360}
    352361
     
    358367void WorldEntity::unmount(int slot)
    359368{
     369    if( this->mountPoints[slot] == NULL)
     370  {
     371    PRINTF(0)("you tried to remove an entity from a mount point that doesn't exist (slot %i)\n", slot);
     372    return;
     373  }
     374
     375  // unmount the entity
     376  this->mountPoints[slot]->unmount();
    360377}
    361378
Note: See TracChangeset for help on using the changeset viewer.