0) { $change = false; if ($bgold + $cgold == $totalgold + $buildgold) { $totalgold = $cgold; $buildgold = $bgold; $cost = 0; include Inc("dogold.inc"); $totalgold = $cgold; $result = mysql_query("UPDATE Buildings SET Gold='$buildgold' WHERE Id=$v"); } for ($ti=1; $ti <= $Twnb; $ti++) { if ($charitemsW[$ti] + $itemsW[$ti] == $cw[$ti] + $w[$ti]) { $charitemsW[$ti] = $cw[$ti]; $itemsW[$ti] = $w[$ti]; $change = true; } } for ($ti=1; $ti <= $Tanb; $ti++) { if ($charitemsA[$ti] + $itemsA[$ti] == $ca[$ti] + $a[$ti]) { $charitemsA[$ti] = $ca[$ti]; $itemsA[$ti] = $a[$ti]; $change = true; } } for ($ti=1; $ti <= $Tfnb; $ti++) { if ($charitemsF[$ti] + $itemsF[$ti] == $cf[$ti] + $f[$ti]) { $charitemsF[$ti] = $cf[$ti]; $itemsF[$ti] = $f[$ti]; $change = true; } } for ($ti=1; $ti <= $Tonb; $ti++) { if ($charitemsO[$ti] + $itemsO[$ti] == $co[$ti] + $o[$ti]) { $charitemsO[$ti] = $co[$ti]; $itemsO[$ti] = $o[$ti]; $change = true; } } if ($change) { if ($charitemsW[$weapon] == 0) { $result = mysql_query("UPDATE Characters SET Weapon=0 WHERE Id=$id"); } if ($charitemsA[$armor] == 0) { $result = mysql_query("UPDATE Characters SET Armor=0 WHERE Id=$id"); } if ($charitemsA[$shield] == 0) { $result = mysql_query("UPDATE Characters SET Shield=0 WHERE Id=$id"); } if ($charitemsA[$armorplus] == 0) { $result = mysql_query("UPDATE Characters SET ArmorPlus=0 WHERE Id=$id"); } if ($charitemsA[$shieldplus] == 0) { $result = mysql_query("UPDATE Characters SET ShieldPlus=0 WHERE Id=$id"); } RecrunchEquipment(); $result = mysql_query("UPDATE Characters SET Equipment='$equipment' WHERE Id=$id"); RecrunchStorage(); $result = mysql_query("UPDATE Buildings SET Storage='$storage' WHERE Id=$v"); } } ?>