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