Fehler behoben der zum unverdienten Sieg eines Chars fuehrte, der genau auf 0 hp rauskam beim verlieren.

main
hecht 10 years ago
parent 7462d0d64c
commit d0f5ca0ac3

@ -256,14 +256,14 @@ function calculateFight(array $char1, array $char2) {
$rundenArray[] = $runde; $rundenArray[] = $runde;
} }
if(($k_hp[0] > $k_aufgabe[0] && $k_hp[1] > $k_aufgabe[1]) || ($k_hp[0] < $k_aufgabe[0] && $k_hp[1] < $k_aufgabe[1])) { if(($k_hp[0] > $k_aufgabe[0] && $k_hp[1] > $k_aufgabe[1]) || ($k_hp[0] <= $k_aufgabe[0] && $k_hp[1] <= $k_aufgabe[1])) {
// Both are above or both are below their limit to surrender? // Both are above or both are below their limit to surrender?
if($k_hp[0] >= $k_hp[1]) { // If even the creator wins ;) if($k_hp[0] >= $k_hp[1]) { // If even the creator wins ;)
$metaData['winner'] = $chara_1['id']; $metaData['winner'] = $chara_1['id'];
} else { } else {
$metaData['winner'] = $chara_2['id']; $metaData['winner'] = $chara_2['id'];
} }
} else if($k_hp[0] < $k_aufgabe[0]) { // char1 is about to surrender } else if($k_hp[0] <= $k_aufgabe[0]) { // char1 is about to surrender
$metaData['winner'] = $chara_2['id']; $metaData['winner'] = $chara_2['id'];
} else { } else {
$metaData['winner'] = $chara_1['id']; $metaData['winner'] = $chara_1['id'];

Loading…
Cancel
Save