Refactor custom points handling in Swar6 reader

The logic for handling custom points in the Swar6 reader has been refactored. Previously, if presence points were not set, the absence value was set to the presence value and then the presence key was unset. Now, if presence points are not set, the absence value is directly set to 0 and then the presence key is unset.
This commit is contained in:
Jeroen De Meerleer 2024-09-19 12:21:45 +02:00
parent 58851af343
commit ebe61ad378
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -285,8 +285,8 @@ class Swar6 implements ReaderInterface
$custompoints['presence'] = $this->readData('Int', $swshandle) / 4; $custompoints['presence'] = $this->readData('Int', $swshandle) / 4;
$this->Tournament->IsPresencePoints = (bool)$this->readData('Int', $swshandle); $this->Tournament->IsPresencePoints = (bool)$this->readData('Int', $swshandle);
if(!$this->Tournament->IsPresencePoints) { if(!$this->Tournament->IsPresencePoints) {
$custompoints['absence'] = $custompoints['presence']; $custompoints['absence'] = 0;
unset($custompoints['presence']) unset($custompoints['presence']);
} }
if($applycustompoints) $this->Tournament->CustomPoints = $custompoints; if($applycustompoints) $this->Tournament->CustomPoints = $custompoints;
$this->Tournament->TournoiStd = $this->readData('Int', $swshandle); $this->Tournament->TournoiStd = $this->readData('Int', $swshandle);