fix conquer artefact

This commit is contained in:
Shadowss
2013-11-04 09:02:14 +02:00
parent cd544cc7f0
commit 7e9bc3e4a8
+15 -10
View File
@@ -2405,16 +2405,21 @@ if($data['t11'] > 0){
}
}
} else {
$artifact = $database->getOwnArtefactInfo($data['to']);
if ($artifact['vref'] == $data['to']) {
if ($database->canClaimArtifact($data['from'],$artifact['vref'],$artifact['size'],$artifact['type'])) {
$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";
} else {
$info_chief = $hero_pic.",Your hero could not claim the artefact and gained ".$heroxp." XP from the battle";
}
}
global $form;
if ($heroxp == 0) {
$xp=" no XP from the battle";
} else {
$xp=" gained ".$heroxp." XP from the battle";
}
$artifact = $database->getOwnArtefactInfo($data['to']);
if (!empty($artifact)) {
if ($database->canClaimArtifact($data['from'],$artifact['vref'],$artifact['size'],$artifact['type'])) {
$database->claimArtefact($data['from'],$data['to'],$database->getVillageField($data['from'],"owner"));
$info_chief = $hero_pic.",Your hero is carrying home a artefact and".$xp;
} else {
$info_chief = $hero_pic.",".$form->getError("error").$xp;
}
}
}
}