From 4e546f64041708e5b73dc81e9aabe95d9cc9b81a Mon Sep 17 00:00:00 2001 From: kremsy Date: Wed, 29 Mar 2017 18:29:02 +0200 Subject: [PATCH] cb fix --- .../ShootMania/OnHitNearMissArmorEmptyStructure.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/Callbacks/Structures/ShootMania/OnHitNearMissArmorEmptyStructure.php b/core/Callbacks/Structures/ShootMania/OnHitNearMissArmorEmptyStructure.php index 740e9c6b..f0b56e2c 100644 --- a/core/Callbacks/Structures/ShootMania/OnHitNearMissArmorEmptyStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnHitNearMissArmorEmptyStructure.php @@ -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); }