distance and stuntsscore not available in CP-Callback of the new game

This commit is contained in:
Alexander Nell 2020-07-17 14:26:03 +02:00
parent 44d8fd1db2
commit 2f57ee3d6c

View File

@ -39,14 +39,14 @@ class OnWayPointEventStructure extends BasePlayerTimeStructure {
$this->raceTime = (int) $this->getPlainJsonObject()->racetime; $this->raceTime = (int) $this->getPlainJsonObject()->racetime;
$this->lapTime = (int) $this->getPlainJsonObject()->laptime; $this->lapTime = (int) $this->getPlainJsonObject()->laptime;
$this->stuntsScore = $this->getPlainJsonObject()->stuntsscore; $this->stuntsScore = isset($this->getPlainJsonObject()->stuntsscore) ? $this->getPlainJsonObject()->stuntsscore : null;
$this->checkPointInRace = (int) $this->getPlainJsonObject()->checkpointinrace; $this->checkPointInRace = (int) $this->getPlainJsonObject()->checkpointinrace;
$this->checkPointInLap = (int) $this->getPlainJsonObject()->checkpointinlap; $this->checkPointInLap = (int) $this->getPlainJsonObject()->checkpointinlap;
$this->isEndRace = Formatter::parseBoolean($this->getPlainJsonObject()->isendrace); $this->isEndRace = Formatter::parseBoolean($this->getPlainJsonObject()->isendrace);
$this->isEndLap = Formatter::parseBoolean($this->getPlainJsonObject()->isendlap); $this->isEndLap = Formatter::parseBoolean($this->getPlainJsonObject()->isendlap);
$this->blockId = $this->getPlainJsonObject()->blockid; $this->blockId = $this->getPlainJsonObject()->blockid;
$this->speed = $this->getPlainJsonObject()->speed; $this->speed = $this->getPlainJsonObject()->speed;
$this->distance = $this->getPlainJsonObject()->distance; $this->distance = isset($this->getPlainJsonObject()->distance) ? $this->getPlainJsonObject()->distance : null;
if ($this->checkPointInRace > 0) { if ($this->checkPointInRace > 0) {
$currentMap = $this->maniaControl->getMapManager()->getCurrentMap(); $currentMap = $this->maniaControl->getMapManager()->getCurrentMap();