mx cleanup

This commit is contained in:
kremsy 2014-02-16 17:42:35 +01:00 committed by Steffen Schröder
parent da50ad5bdb
commit 3dd29b2303

View File

@ -28,16 +28,13 @@ class MXMapInfo {
public function __construct($prefix, $mx) { public function __construct($prefix, $mx) {
$this->prefix = $prefix; $this->prefix = $prefix;
if ($mx) { if ($mx) {
if ($this->prefix == 'tm') { if ($this->prefix == 'tm') {
$dir = 'tracks'; $dir = 'tracks';
} else { // 'sm' || 'qm'
$dir = 'maps';
}
if ($this->prefix == 'tm' || !property_exists($mx, "MapID")) {
$this->id = $mx->TrackID; $this->id = $mx->TrackID;
$this->uid = isset($mx->TrackUID) ? $mx->TrackUID : ''; $this->uid = isset($mx->TrackUID) ? $mx->TrackUID : '';
} else { } else {
$dir = 'maps';
$this->id = $mx->MapID; $this->id = $mx->MapID;
$this->uid = isset($mx->MapUID) ? $mx->MapUID : ''; $this->uid = isset($mx->MapUID) ? $mx->MapUID : '';
} }