improve diplomacy

This commit is contained in:
unknown
2012-04-16 14:42:20 +03:00
parent 78f22d0c1f
commit e8353d1645
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -348,6 +348,14 @@
if($aType >= 1 and $aType <= 3) {
if(!$database->diplomacyInviteCheck($database->getAllianceID($aName), $session->alliance)) {
$database->diplomacyInviteAdd($session->alliance, $database->getAllianceID($aName), $aType);
if($aType == 1){
$notice = "offer a confederation to";
}else if($aType == 2){
$notice = "offer non-aggression pact to";
}else if($aType == 3){
$notice = "declare war on";
}
$database->insertAlliNotice($session->alliance, '<a href="allianz.php?aid=' . $session->alliance . '">' . $database->getAllianceName($session->alliance) . '</a> '. $notice .' <a href="allianz.php?aid=' . $database->getAllianceID($aName) . '">' . $aName . '</a>.');
$form->addError("name", "Invite sended");
} else {
$form->addError("name", "You have already sended them a invite");
+1 -1
View File
@@ -1216,7 +1216,7 @@
}
function diplomacyCancelExistingRelationship($id, $session_alliance) {
$q = "DELETE FROM " . TB_PREFIX . "diplomacy WHERE id = $id AND alli2 = $session_alliance";
$q = "DELETE FROM " . TB_PREFIX . "diplomacy WHERE id = $id AND alli2 = $session_alliance OR id = $id AND alli1 = $session_alliance";
return mysql_query($q, $this->connection);
}