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; + } }