From 609337434df9088c2eb89638bd6fec5dd05255ad Mon Sep 17 00:00:00 2001 From: kremsy Date: Sat, 13 Dec 2014 16:25:11 +0100 Subject: [PATCH] added hitdistance to the playerhit-structure --- .../Structures/PlayerHitStructure.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/core/Callbacks/Structures/PlayerHitStructure.php b/core/Callbacks/Structures/PlayerHitStructure.php index 84b281b5..b2a53c53 100644 --- a/core/Callbacks/Structures/PlayerHitStructure.php +++ b/core/Callbacks/Structures/PlayerHitStructure.php @@ -1,5 +1,11 @@ + * @copyright 2014 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ namespace ManiaControl\Callbacks\Structures; use ManiaControl\ManiaControl; @@ -14,6 +20,8 @@ class PlayerHitStructure { private $damage; private $shooterPoints; private $weapon; + private $hitDistance = 0; + /** @var ManiaControl $maniaControl */ private $maniaControl; @@ -30,6 +38,11 @@ class PlayerHitStructure { $this->damage = $data[2]; $this->weapon = $data[3]; $this->shooterPoints = $data[4]; + + //TODO remove key check in some months (hitDistance got implemented 2014-10-16) + if (array_key_exists(5, $data)) { + $this->hitDistance = $data[5]; + } } /** @@ -77,4 +90,13 @@ class PlayerHitStructure { // TODO: any way of returning type "Weapon?" return $this->weapon; } + + /** + * Get The Hit Distance + * + * @return int + */ + public function getHitDistance() { + return $this->hitDistance; + } }