Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 27, 2017, 4:38:50 PM (7 years ago)
Author:
kohlia
Message:

Pawn killing works too now

Location:
code/branches/ScriptableController_HS17/src/orxonox/worldentities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.cc

    r11583 r11606  
    4545#include "worldentities/CameraPosition.h"
    4646#include "overlays/OverlayGroup.h"
    47 #include "scriptablecontroller/scriptable_controller.h"
    4847
    4948namespace orxonox
     
    127126        XMLPortObject(ControllableEntity, CameraPosition, "camerapositions", addCameraPosition, getCameraPosition, xmlelement, mode);
    128127        XMLPortObject(ControllableEntity, Controller,     "controller",      setXMLController,  getXMLController,  xmlelement, mode);
    129 
    130         if(!this->id_.empty() && this->getLevel() != nullptr)
    131             this->getLevel()->getScriptableController()->registerControllableEntity(this->id_, this);
    132128    }
    133129
  • code/branches/ScriptableController_HS17/src/orxonox/worldentities/pawns/Pawn.cc

    r11176 r11606  
    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"
     
    159161
    160162        XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
     163
     164        if(!this->id_.empty() && this->getLevel() != nullptr)
     165            this->getLevel()->getScriptableController()->registerPawn(this->id_, this);
    161166    }
    162167
     
    281286        {
    282287            // Health-damage cannot be absorbed by shields.
    283             // Shield-damage only reduces shield health. 
     288            // Shield-damage only reduces shield health.
    284289            // Normal damage can be (partially) absorbed by shields.
    285290
     
    301306                this->setHealth(this->health_ - (damage - shielddamage) - healthdamage);
    302307            }
     308            this->getLevel()->getScriptableController()->pawnHit(this, originator, this->health_, this->shieldHealth_);
    303309
    304310            this->lastHitOriginator_ = originator;
     
    401407            }
    402408        }
     409
     410        this->getLevel()->getScriptableController()->pawnKilled(this);
    403411    }
    404412    void Pawn::goWithStyle()
     
    624632        {
    625633            // delete all debug models
    626             for(Model* model : debugWeaponSlotModels_) 
     634            for(Model* model : debugWeaponSlotModels_)
    627635            {
    628636                model->destroy();
Note: See TracChangeset for help on using the changeset viewer.