Skip to content

Commit

Permalink
close #36 new maps can not be created
Browse files Browse the repository at this point in the history
  • Loading branch information
exodus4d committed Sep 29, 2015
1 parent d78fb9e commit 962c380
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
12 changes: 7 additions & 5 deletions app/main/model/alliancemodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ public function getMaps(){

$this->filter('mapAlliances',
['active = ?', 1],
[
'limit' => $f3->get('PATHFINDER.MAX_MAPS_ALLIANCE'),
'order' => 'created'
]
['order' => 'created']
);

if($this->mapAlliances){
$mapCount = 0;
foreach($this->mapAlliances as $mapAlliance){
if($mapAlliance->mapId->isActive()){
if(
$mapAlliance->mapId->isActive() &&
$mapCount < $f3->get('PATHFINDER.MAX_MAPS_ALLIANCE')
){
$maps[] = $mapAlliance->mapId;
$mapCount++;
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions app/main/model/corporationmodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function getData(){
$cooperationData->name = $this->name;
$cooperationData->sharing = $this->sharing;


return $cooperationData;
}

Expand All @@ -47,16 +46,18 @@ public function getMaps(){

$this->filter('mapCorporations',
['active = ?', 1],
[
'limit' => $f3->get('PATHFINDER.MAX_MAPS_CORPORATION'),
'order' => 'created'
]
['order' => 'created']
);

if($this->mapCorporations){
$mapCount = 0;
foreach($this->mapCorporations as $mapCorporation){
if($mapCorporation->mapId->isActive()){
if(
$mapCorporation->mapId->isActive() &&
$mapCount < $f3->get('PATHFINDER.MAX_MAPS_CORPORATION')
){
$maps[] = $mapCorporation->mapId;
$mapCount++;
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions app/main/model/usermodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ public function getMaps(){
$this->filter(
'userMaps',
['active = ?', 1],
[
'order' => 'created'
]
['order' => 'created']
);

$maps = [];
Expand Down

0 comments on commit 962c380

Please sign in to comment.