Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2018, 2:07:03 PM (7 years ago)
Author:
adamc
Message:

merged HS17 into FS18

Location:
code/branches/ScriptableController_FS18
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_FS18

  • code/branches/ScriptableController_FS18/src/orxonox/worldentities/pawns/Pawn.cc

    r11783 r11855  
    5050#include "sound/WorldSound.h"
    5151#include "core/object/ObjectListIterator.h"
     52#include "Level.h"
     53#include "scriptablecontroller/scriptable_controller.h"
    5254
    5355#include "controllers/FormationController.h"
     
    160162
    161163        XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
     164
     165        if(!this->id_.empty() && this->getLevel() != nullptr)
     166            this->getLevel()->getScriptableController()->registerPawn(this->id_, this);
    162167    }
    163168
     
    282287        {
    283288            // Health-damage cannot be absorbed by shields.
    284             // Shield-damage only reduces shield health. 
     289            // Shield-damage only reduces shield health.
    285290            // Normal damage can be (partially) absorbed by shields.
    286291
     
    302307                this->setHealth(this->health_ - (damage - shielddamage) - healthdamage);
    303308            }
     309            this->getLevel()->getScriptableController()->pawnHit(this, originator, this->health_, this->shieldHealth_);
    304310
    305311            this->lastHitOriginator_ = originator;
     
    402408            }
    403409        }
     410
     411        this->getLevel()->getScriptableController()->pawnKilled(this);
    404412    }
    405413    void Pawn::goWithStyle()
     
    625633        {
    626634            // delete all debug models
    627             for(Model* model : debugWeaponSlotModels_) 
     635            for(Model* model : debugWeaponSlotModels_)
    628636            {
    629637                model->destroy();
Note: See TracChangeset for help on using the changeset viewer.