From c2d5612a1f2483641b4ae39464886fc07acf8fe3 Mon Sep 17 00:00:00 2001 From: armando1980 Date: Sun, 26 Jan 2014 20:02:56 -0500 Subject: [PATCH] fix lost troop when target delete by armando solution loss and troops when you attack the target you delete the account --- GameEngine/Automation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 0d39f1dc..1d7685e9 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -387,7 +387,7 @@ class Automation { $database->addMovement(4,$movedata['to'],$movedata['from'],$movedata['ref'],$time,$time+$time2); $database->setMovementProc($movedata['moveid']); } - $q = "DELETE FROM ".TB_PREFIX."movement where `from` = ".$village; + $q = "DELETE FROM ".TB_PREFIX."movement where proc = 0 AND ((`to` = $village AND sort_type=4) OR (`from` = $village AND sort_type=3))"; $database->query($q); $getprisoners = $database->getPrisoners($village); foreach($getprisoners as $pris) { @@ -2975,7 +2975,7 @@ $wallimg = "query($q); $q = "DELETE FROM ".TB_PREFIX."raidlist where towref = $wref"; $database->query($q); - $q = "DELETE FROM ".TB_PREFIX."movement where proc = 0 AND ((`from` = $wref AND `to` = $wref) OR (`from` = $wref AND sort_type=3))"; + $q = "DELETE FROM ".TB_PREFIX."movement where proc = 0 AND ((`to` = $wref AND sort_type=4) OR (`from` = $wref AND sort_type=3))"; $database->query($q); $getmovement = $database->getMovement(3,$wref,1);