From ebece2137a879a6a2a6fb0bbc67fc21147ce6bb9 Mon Sep 17 00:00:00 2001 From: hecht Date: Mon, 1 Dec 2014 21:18:06 +0000 Subject: [PATCH] final fixes for special char creation --- ag/dragonballs.php | 2 +- ag/include/erstellfunctions.inc.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ag/dragonballs.php b/ag/dragonballs.php index 42638d5..3e35060 100644 --- a/ag/dragonballs.php +++ b/ag/dragonballs.php @@ -92,7 +92,7 @@ function wuenscheSpecialChar($user, $specialcharname, $newname = ''){ $chars = getCharsOfUser($user['id']); foreach($chars as $char) { - if($char['rasse_a']['id'] == $rasse) { + if($char['rasse_a']['id'] == $rasse['id']) { displayErrorMessage(NULL,'Der '.$specialcharname.'-Slot ist schon durch '.$char['name'].' belegt!!',displayHistoryBackLink()); return false; } diff --git a/ag/include/erstellfunctions.inc.php b/ag/include/erstellfunctions.inc.php index 13eb99b..b9959ed 100644 --- a/ag/include/erstellfunctions.inc.php +++ b/ag/include/erstellfunctions.inc.php @@ -34,7 +34,7 @@ function hasUserFreeCharSlot($user, $special = false) { } } - if(!$special) { + if(!$special || $special_chars > 0) { if($special_chars > 0) $special_chars--; @@ -42,7 +42,8 @@ function hasUserFreeCharSlot($user, $special = false) { $slots_avail = $user['char_max']; return $chars_avail < $slots_avail; } else { - return $special_chars < 2; + // special char but no special char yet available! + return true; } return false;