Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2008, 8:13:43 PM (15 years ago)
Author:
landauf
Message:
  • Removed directional-light-hack from Scene
  • Many changes in Light, works in all game-modes (standalone, dedicated, server and client)
  • Fixed a bug which caused clients to not having shadows

There's still a big problem, bug I can't explain it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/orxonox/objects/gametypes/Gametype.cc

    r2438 r2447  
    149149    void Gametype::pawnKilled(Pawn* victim, Pawn* killer)
    150150    {
    151         if (victim)
     151        if (victim && victim->getPlayer())
    152152        {
    153153            std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.find(victim->getPlayer());
    154             it->second = PlayerState::Dead;
    155 
    156             ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator());
    157             if (victim->getCamera())
    158             {
    159                 entity->setPosition(victim->getCamera()->getWorldPosition());
    160                 entity->setOrientation(victim->getCamera()->getWorldOrientation());
     154            if (it != this->players_.end())
     155            {
     156                it->second = PlayerState::Dead;
     157
     158                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator());
     159                if (victim->getCamera())
     160                {
     161                    entity->setPosition(victim->getCamera()->getWorldPosition());
     162                    entity->setOrientation(victim->getCamera()->getWorldOrientation());
     163                }
     164                else
     165                {
     166                    entity->setPosition(victim->getWorldPosition());
     167                    entity->setOrientation(victim->getWorldOrientation());
     168                }
     169                it->first->startControl(entity);
    161170            }
    162171            else
    163             {
    164                 entity->setPosition(victim->getWorldPosition());
    165                 entity->setOrientation(victim->getWorldOrientation());
    166             }
    167             it->first->startControl(entity);
     172                COUT(2) << "Warning: Killed Pawn was not in the playerlist" << std::endl;
    168173        }
    169174    }
Note: See TracChangeset for help on using the changeset viewer.