Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10643 in orxonox.OLD for trunk/src/world_entities/npcs/mover.cc


Ignore:
Timestamp:
Apr 29, 2007, 6:51:28 PM (17 years ago)
Author:
bknecht
Message:

improvements by landauf on bsp, rotor and wireframe (does build, should work)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/npcs/mover.cc

    r10618 r10643  
    8282        .describe("sets the action time of the door")
    8383        .defaultValues(1.0);
     84    LoadParam(root, "stay-open-time", this, Mover, setStayOpenTime)
     85        .describe("sets the time, the door must stay open")
     86        .defaultValues(0.0);
    8487    LoadParam(root, "opening-sound", this, Mover, setOpeningSoundFile)
    8588        .describe("Sets the file of the opening sound source");
     
    146149                this->soundSource_moving.stop();
    147150        }
     151        this->openTime = 0;
    148152    }
    149153    else if (this->state == Open)
    150154    {
    151         if (!this->checkPlayerInActionRadius())
    152         {
    153             this->state = Closing;
    154             if (this->soundBuffer_closing.loaded())
    155                 this->soundSource_starting.play(this->soundBuffer_closing);
    156             if (this->soundBuffer_moving.loaded())
    157                 this->soundSource_moving.play(this->soundBuffer_moving, 1.0, true);
     155        this->openTime += dt;
     156        if (this->openTime >= this->stayOpenTime)
     157        {
     158            if (!this->checkPlayerInActionRadius())
     159            {
     160                this->state = Closing;
     161                if (this->soundBuffer_closing.loaded())
     162                    this->soundSource_starting.play(this->soundBuffer_closing);
     163                if (this->soundBuffer_moving.loaded())
     164                    this->soundSource_moving.play(this->soundBuffer_moving, 1.0, true);
     165            }
    158166        }
    159167    }
Note: See TracChangeset for help on using the changeset viewer.