final fixes for special char creation

main
hecht 10 years ago
parent 966adc533b
commit ebece2137a

@ -92,7 +92,7 @@ function wuenscheSpecialChar($user, $specialcharname, $newname = ''){
$chars = getCharsOfUser($user['id']); $chars = getCharsOfUser($user['id']);
foreach($chars as $char) { 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()); displayErrorMessage(NULL,'Der '.$specialcharname.'-Slot ist schon durch '.$char['name'].' belegt!!',displayHistoryBackLink());
return false; return false;
} }

@ -34,7 +34,7 @@ function hasUserFreeCharSlot($user, $special = false) {
} }
} }
if(!$special) { if(!$special || $special_chars > 0) {
if($special_chars > 0) if($special_chars > 0)
$special_chars--; $special_chars--;
@ -42,7 +42,8 @@ function hasUserFreeCharSlot($user, $special = false) {
$slots_avail = $user['char_max']; $slots_avail = $user['char_max'];
return $chars_avail < $slots_avail; return $chars_avail < $slots_avail;
} else { } else {
return $special_chars < 2; // special char but no special char yet available!
return true;
} }
return false; return false;

Loading…
Cancel
Save