Merge pull request #450 from Shadowss/patch-113

fix conquer artefact
This commit is contained in:
yi12345
2013-11-07 14:14:27 -08:00
+9 -4
View File
@@ -2405,14 +2405,19 @@ if($data['t11'] > 0){
} }
} }
} else { } else {
global $form;
if ($heroxp == 0) {
$xp=" no XP from the battle";
} else {
$xp=" gained ".$heroxp." XP from the battle";
}
$artifact = $database->getOwnArtefactInfo($data['to']); $artifact = $database->getOwnArtefactInfo($data['to']);
if ($artifact['vref'] == $data['to']) { if (!empty($artifact)) {
if ($database->canClaimArtifact($data['from'],$artifact['vref'],$artifact['size'],$artifact['type'])) { if ($database->canClaimArtifact($data['from'],$artifact['vref'],$artifact['size'],$artifact['type'])) {
$database->claimArtefact($data['from'],$data['to'],$database->getVillageField($data['from'],"owner")); $database->claimArtefact($data['from'],$data['to'],$database->getVillageField($data['from'],"owner"));
$info_chief = $hero_pic.",Your hero is carrying home a artefact and gained ".$heroxp." XP from the battle"; $info_chief = $hero_pic.",Your hero is carrying home a artefact and".$xp;
} else { } else {
$info_chief = $hero_pic.",Your hero could not claim the artefact and gained ".$heroxp." XP from the battle"; $info_chief = $hero_pic.",".$form->getError("error").$xp;
} }
} }
} }