Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2644 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Oct 25, 2004, 4:26:40 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: BUGFIX - Player spawn problem resolved (I hope…)

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/error.h

    r2636 r2644  
    2424// this are the two undefined error nr. Don't use them ...
    2525#define ERROR -1
    26 #define NO_ERROR 0
     26#define NERROR 0
    2727
    2828/*!
  • orxonox/trunk/src/world.cc

    r2640 r2644  
    5151{
    5252  Orxonox *orx = Orxonox::getInstance();
    53   orx->get_localinput()->unbind (localPlayer);
    54   delete entities;
     53  orx->get_localinput()->unbind (this->localPlayer);
     54  delete this->entities;
     55  delete this->localCamera;
    5556}
    5657
     
    112113           
    113114            // create a player
    114             WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
     115            //WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
     116            WorldEntity* myPlayer = new Player();
     117            this->spawn(myPlayer);
    115118            this->localPlayer = myPlayer;           
    116119
     
    144147           
    145148            // create a player
    146             WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
     149            //WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
     150            WorldEntity* myPlayer = new Player();
     151            this->spawn(myPlayer);
    147152            this->localPlayer = myPlayer;
    148153           
     
    527532  return this->localCamera;
    528533}
     534
     535
     536void World::spawn(WorldEntity* entity)
     537{
     538  Location zeroloc;
     539  Location* loc = NULL;
     540  WorldEntity* owner;
     541  //T* entity = new T();
     542  entities->add (entity, LIST_ADD_NEXT);
     543  //if( loc == NULL)
     544  //{
     545      zeroloc.dist = 0;
     546      zeroloc.part = 0;
     547      zeroloc.pos = Vector();
     548      zeroloc.rot = Quaternion();
     549      loc = &zeroloc;
     550      //}
     551  entity->init (loc, owner);
     552  if (entity->bFree)
     553    {
     554      this->track[loc->part].map_coords( loc, entity->get_placement());
     555    }
     556  entity->post_spawn ();
     557  //return entity;
     558}
  • orxonox/trunk/src/world.h

    r2640 r2644  
    5050  Camera* getCamera();
    5151  //private:
    52  
     52
     53  void spawn(WorldEntity* entity);
     54
    5355  List<WorldEntity>* entities;
    5456 
Note: See TracChangeset for help on using the changeset viewer.