This commit is contained in:
kremsy 2017-03-29 18:29:02 +02:00
parent 498237491f
commit 4e546f6404

View File

@ -43,7 +43,6 @@ class OnHitNearMissArmorEmptyStructure extends BaseStructure {
$jsonObj = $this->getPlainJsonObject();
$this->time = $jsonObj->time;
$this->weapon = $jsonObj->weapon;
$this->damage = $jsonObj->damage; //TODO does only exist on onhit -> make baseclass
$this->shooterPosition = new Position();
$this->shooterPosition->setX($jsonObj->shooterposition->x);
@ -59,6 +58,10 @@ class OnHitNearMissArmorEmptyStructure extends BaseStructure {
$this->distance = $this->getPlainJsonObject()->distance;
}
if (property_exists($this->getPlainJsonObject(), 'damage')) {
$this->damage = $this->getPlainJsonObject()->damage;
}
$this->shooter = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->shooter);
$this->victim = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->victim);
}