do not achieve Achievements with reached deadline or no conditions

This commit is contained in:
coderkun 2014-04-24 12:15:26 +02:00
commit ba05925d10

View file

@ -165,6 +165,11 @@
// Check conditions // Check conditions
foreach($achievements as &$achievement) foreach($achievements as &$achievement)
{ {
// Check deadline
if($achievement['deadline'] < date('Y-m-d H:i:s')) {
continue;
}
// Get conditions // Get conditions
$conditions = array(); $conditions = array();
$progress = 0; $progress = 0;
@ -237,6 +242,11 @@
break; break;
} }
// Do not achieve Achievements without conditions
if(empty($conditions)) {
continue;
}
// Check conditions // Check conditions
$achieved = ($achievement['all_conditions'] == 1); $achieved = ($achievement['all_conditions'] == 1);
foreach($conditions as &$condition) foreach($conditions as &$condition)