mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-08 13:46:09 +00:00
improve diplomacy
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user