Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 27, 2010, 7:53:30 PM (14 years ago)
Author:
dafrick
Message:

Fixing small bug in Script (regarding number of executions).
Fixed bug in WorldEntity, that caused the visibility and activity to be synchronized incorrectly (since bVisibleMem and bActiveMem are not synchronized).
Some small changed in documentation.
Started "synchronizing" pickups. Seems to work (except GUI), but haven't done any extensive testing yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r7401 r7493  
    214214        SUPER(WorldEntity, changedActivity);
    215215
    216         for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
    217         {
    218             if(!this->isActive())
    219             {
    220                 (*it)->bActiveMem_ = (*it)->isActive();
    221                 (*it)->setActive(this->isActive());
    222             }
    223             else
    224             {
    225                 (*it)->setActive((*it)->bActiveMem_);
     216        if(GameMode::isMaster())
     217        {
     218            for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
     219            {
     220                if(!this->isActive())
     221                {
     222                    (*it)->bActiveMem_ = (*it)->isActive();
     223                    (*it)->setActive(this->isActive());
     224                }
     225                else
     226                {
     227                    (*it)->setActive((*it)->bActiveMem_);
     228                }
    226229            }
    227230        }
     
    236239        SUPER(WorldEntity, changedVisibility);
    237240
    238         for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
    239         {
    240             if(!this->isVisible())
    241             {
    242                 (*it)->bVisibleMem_ = (*it)->isVisible();
    243                 (*it)->setVisible(this->isVisible());
    244             }
    245             else
    246             {
    247                 (*it)->setVisible((*it)->bVisibleMem_);
     241        if(GameMode::isMaster())
     242        {
     243            for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
     244            {
     245                if(!this->isVisible())
     246                {
     247                    (*it)->bVisibleMem_ = (*it)->isVisible();
     248                    (*it)->setVisible(this->isVisible());
     249                }
     250                else
     251                {
     252                    (*it)->setVisible((*it)->bVisibleMem_);
     253                }
    248254            }
    249255        }
Note: See TracChangeset for help on using the changeset viewer.