@ -297,7 +297,7 @@ function getAttacksforChar($charid, $mode = 0) {
// $sql = 'select a.name, a.id, a.level, if(find_in_set(\'0\', req_atk) = 0, a.req_atk, substr(a.req_atk, 1, locate(\',0\', a.req_atk) - 1)) as req_atk , geld, ifnull((select l.benutzt from lernen l where l.besitzer = '.$char['id'].' and at_id = a.id),0) as benutzt, a.id not in (select l.at_id from lernen l where l.besitzer = '.$char['id'].') as unknown from attacken a where find_in_set('.$char_race.', a.rassen) order by level';
$sql_append = '';
if($char['frucht'] !== NULL) {
$sql_append1 = ' OR (frucht = (Select id from wochen_markt where item = \''.$char['frucht'].'\')) ';
$sql_append2 = ' AND (frucht <> (Select id from wochen_markt where item = \''.$char['frucht'].'\')) ';
@ -310,7 +310,7 @@ function getAttacksforChar($charid, $mode = 0) {
// make a union out of both (TODO: maybe an outer join would result into the same result)
$sql = '('.$sql.') union distinct ('.$sql2.') order by level';
$qry = mysql_query($sql);
if($qry === FALSE) // print sql on error
echo '<br>'.$sql.'<br>';
@ -380,5 +380,14 @@ function getAttacksforChar($charid, $mode = 0) {
return $overview;
}
/**
* This function reads out the attack set of the char