Update Automation.php

This commit is contained in:
Shadow
2013-12-09 17:46:25 +02:00
parent d8f144fecc
commit 6126a9ca49
+11 -7
View File
@@ -2478,14 +2478,18 @@ class Automation {
} else { } else {
$xp=" gained ".$heroxp." XP from the battle"; $xp=" gained ".$heroxp." XP from the battle";
} }
$artifact = $database->getOwnArtefactInfo($data['to']); if ($type=='3') {
if (!empty($artifact)) { $artifact = $database->getOwnArtefactInfo($data['to']);
if ($database->canClaimArtifact($data['from'],$artifact['vref'],$artifact['size'],$artifact['type'])) { if (!empty($artifact)) {
$database->claimArtefact($data['from'],$data['to'],$database->getVillageField($data['from'],"owner")); if ($database->canClaimArtifact($data['from'],$artifact['vref'],$artifact['size'],$artifact['type'])) {
$info_hero = $hero_pic.",Your hero is carrying home a artefact and".$xp; $database->claimArtefact($data['from'],$data['to'],$database->getVillageField($data['from'],"owner"));
} else { $info_hero = $hero_pic.",Your hero is carrying home a artefact".$xp;
$info_hero = $hero_pic.",".$form->getError("error").$xp; } else {
$info_hero = $hero_pic.",".$form->getError("error").$xp;
}
} }
}else {
$info_hero = $hero_pic.",Your hero could not claim the artefact during raid".$xp;
} }
} }
}elseif($data['t11']>0) { }elseif($data['t11']>0) {