Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 28, 2006, 4:56:34 PM (19 years ago)
Author:
patrick
Message:

more door work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/door.cc

    r8870 r8872  
    6262{
    6363  this->setClassID(CL_DOOR, "Door");
    64   this->toList(OM_GROUP_00);
     64  this->toList(OM_COMMON);
    6565
    6666  this->lastCollided = NULL;
     
    7676  WorldEntity::loadParams(root);
    7777
    78   LoadParam(root, "md2animation", this, Door, setAnim)
    79       .describe("sets the animation of the md2 model")
    80       .defaultValues(1);
     78//   LoadParam(root, "", this, Door, set)
     79//       .describe("sets the animation of the md2 model")
     80//       .defaultValues(1);
    8181
    8282}
     
    9595    ((InteractiveModel*)this->getModel(0))->tick(time);
    9696
    97 }
    9897
    99 
    100 void Door::collidesWith(WorldEntity* entity, const Vector& location)
    101 {
    102   if( this->lastCollided != entity)
    103   {
    104     this->destroy();
    105     this->lastCollided = entity;
    106 
    107     if(State::getGameRules())
    108       State::getGameRules()->registerKill(Kill(entity, this));
    109   }
    11098}
    11199
    112100
    113101
    114 void Door::destroy()
     102/**
     103 * checks if the door is open
     104 */
     105void Door::checkOpen()
    115106{
    116   if( this->bDeath)
    117     return;
    118107
    119   this->bDeath = true;
    120   int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX);
    121108
    122   PRINTF(0)("randi = %i\n", randi);
    123 
    124   if( randi == 1)
    125     this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE);
    126   else if( randi == 2)
    127     this->setAnim(DEATH_FALLFORWARD, MD2_ANIM_ONCE);
    128   else if( randi == 3)
    129     this->setAnim(DEATH_FALLBACKSLOW, MD2_ANIM_ONCE);
    130   else if( randi == 4)
    131     this->setAnim(CROUCH_DEATH, MD2_ANIM_ONCE);
    132   else
    133     this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE);
    134109}
    135110
     111
     112
Note: See TracChangeset for help on using the changeset viewer.