major fix of the clan fights!

main
hecht 13 years ago
parent 64ed0c4259
commit da7190bf7f

@ -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);
} }
} }
@ -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