major fix of the clan fights!

main
hecht 13 years ago
parent 64ed0c4259
commit da7190bf7f

@ -817,7 +817,7 @@ function calculateChallenge($clan_challenge_id) {
echo $sql.'<br>'; echo $sql.'<br>';
return 'Konnte Datenbank-Anfrage nicht durchf&uuml;hren ... breche Skript ab!'; return 'Konnte Datenbank-Anfrage nicht durchf&uuml;hren ... breche Skript ab!';
} }
return NULL; return NULL;
} }
@ -842,11 +842,11 @@ function calculateDavyBackClanFight($clan_challenge_id, $event_id, array $clan_i
$winner = battle($event_id, $char_clan_1, $char_clan_2, ATTACK_SET_DAVY_BACK_FIGHT, $start_time + ($runde-1) * $duration, $start_time + $runde * $duration); $winner = battle($event_id, $char_clan_1, $char_clan_2, ATTACK_SET_DAVY_BACK_FIGHT, $start_time + ($runde-1) * $duration, $start_time + $runde * $duration);
if($winner['id'] == $char_clan_1['id']){ if($winner['id'] == $char_clan_1['id']){
$sql = 'UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[0]; $sql = 'UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[0];
// echo $sql . '<br>'; // echo $sql . '<br>';
mysql_query($sql); mysql_query($sql);
} else { } else {
$sql = 'UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[1]; $sql = 'UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[1];
// echo $sql . '<br>'; // echo $sql . '<br>';
mysql_query($sql); mysql_query($sql);
} }
} }
@ -885,7 +885,7 @@ function calculateSurvivalClanFight($clan_challenge_id, $event_id, array $clan_i
$char_clan_1 = $sieger; // the new array contains the adjusted health parameter $char_clan_1 = $sieger; // the new array contains the adjusted health parameter
mysql_query('UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[1]); mysql_query('UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[1]);
} }
} }
$end_time = $start_time + $runde * $duration; $end_time = $start_time + $runde * $duration;
return $char_clan_1 != null?1:-1; return $char_clan_1 != null?1:-1;
@ -926,7 +926,6 @@ function battle($event_id, array $char1, array $char2, $attack_set, $startTimest
// first persist the fight and then check who was the winner and adjust the char array for him ;) // first persist the fight and then check who was the winner and adjust the char array for him ;)
persistFight($event_id, $combinedArray, $startTimestamp, $endTimestamp); persistFight($event_id, $combinedArray, $startTimestamp, $endTimestamp);
return;
// now get the winners array // now get the winners array
$rounds = $combinedArray['rounds']; $rounds = $combinedArray['rounds'];

Loading…
Cancel
Save