The fights didn't display the "right" winner due the check "is charname like this char-id" can never be true!

main
hecht 13 years ago
parent 4a727df644
commit aa7353fa31

@ -15,7 +15,9 @@ include_once (ROOT_PATH . '/include/parse.inc.php');
function fetchProcessing($user, $char) { function fetchProcessing($user, $char) {
$char_id = $char['id']; $char_id = $char['id'];
$event_ids = getEventIdsToFetch($char_id); $event_ids = getEventIdsToFetch($char_id);
if(count($event_ids) == 0) {
return 'Es gibt nix zum Abholen!<br>';
}
foreach ($event_ids as $event_id) { foreach ($event_ids as $event_id) {
$fight_ids = abholenChar($user, $event_id, $char_id); $fight_ids = abholenChar($user, $event_id, $char_id);
if(!is_array($fight_ids)) { if(!is_array($fight_ids)) {

@ -333,8 +333,6 @@ function getEventFightRoundData($event_id, $event_fight_id, $round) {
$result[$row['event_char_id']] = $row; $result[$row['event_char_id']] = $row;
} }
return $result; return $result;
} }

@ -418,7 +418,7 @@ function displayEventFight($event_id, $event_fight_id) {
} }
if($event_fight_data['passed'] == 1) { if($event_fight_data['passed'] == 1) {
displaySummary($char1['char_name'], $char2['char_name'], $event_fight_data['winner']==$char1['char_name']?$char1['char_name']:$char2['char_name'], $event_fight_metadata[KEY_EXP_CHAR1], $event_fight_metadata[KEY_EXP_CHAR2], $event_fight_metadata[KEY_GELD_CHAR1], $event_fight_metadata[KEY_GELD_CHAR2], $event_fight_metadata[KEY_AXP_CHAR1], $event_fight_metadata[KEY_AXP_CHAR2], $event_fight_metadata[KEY_LOGE], $event_fight_metadata[KEY_SITZ], $event_fight_metadata[KEY_STEH]); displaySummary($char1['char_name'], $char2['char_name'], $event_fight_data['winner']==$char1['event_char_id']?$char1['char_name']:$char2['char_name'], $event_fight_metadata[KEY_EXP_CHAR1], $event_fight_metadata[KEY_EXP_CHAR2], $event_fight_metadata[KEY_GELD_CHAR1], $event_fight_metadata[KEY_GELD_CHAR2], $event_fight_metadata[KEY_AXP_CHAR1], $event_fight_metadata[KEY_AXP_CHAR2], $event_fight_metadata[KEY_LOGE], $event_fight_metadata[KEY_SITZ], $event_fight_metadata[KEY_STEH]);
} else { } else {
displayFightIsOngoing($char1['char_name'], $char2['char_name']); displayFightIsOngoing($char1['char_name'], $char2['char_name']);
} }

@ -209,8 +209,8 @@ function calculateFight(array $char1, array $char2) {
$chara_2['hp'] = $k_hp[1]; $chara_2['hp'] = $k_hp[1];
$chara_2['hp_max'] = $k_hp2[1]; $chara_2['hp_max'] = $k_hp2[1];
$chara_2['mp'] = $k_hp[1]; $chara_2['mp'] = $k_mp[1];
$chara_2['mp_max'] = $k_hp2[1]; $chara_2['mp_max'] = $k_mp2[1];
$runde['char1_array'] = $chara_1; $runde['char1_array'] = $chara_1;
$runde['char2_array'] = $chara_2; $runde['char2_array'] = $chara_2;

Loading…
Cancel
Save