Skip to content

Commit

Permalink
council.inc: remove unnecessary references
Browse files Browse the repository at this point in the history
  • Loading branch information
hemberger committed Apr 21, 2018
1 parent c7073c4 commit 7a22cda
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/Default/council.inc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Council {
public static function &getPresident($gameID,$raceID) {
self::getRaceCouncil($gameID,$raceID);
if(isset(self::$RACE_PRESIDENTS[$gameID][$raceID])&&self::$RACE_PRESIDENTS[$gameID][$raceID]!==false&&is_numeric(self::$RACE_PRESIDENTS[$gameID][$raceID])) {
self::$RACE_PRESIDENTS[$gameID][$raceID] =& SmrPlayer::getPlayer(self::$RACE_PRESIDENTS[$gameID][$raceID],$gameID);
self::$RACE_PRESIDENTS[$gameID][$raceID] = SmrPlayer::getPlayer(self::$RACE_PRESIDENTS[$gameID][$raceID],$gameID);
}
return self::$RACE_PRESIDENTS[$gameID][$raceID];
}
Expand Down Expand Up @@ -146,11 +146,11 @@ function checkPacts($race_id_1) {
$race_id_1 => SmrSector::getLocationSectors($player->getGameID(), LOCATION_GROUP_RACIAL_BEACONS + $race_id_1),
$race_id_2 => SmrSector::getLocationSectors($player->getGameID(), LOCATION_GROUP_RACIAL_BEACONS + $race_id_2)
);
foreach($raceFedSectors as $raceID => &$fedSectors) {
foreach($raceFedSectors as $raceID => $fedSectors) {
$otherRaceID = $raceID == $race_id_1 ? $race_id_2 : $race_id_1;
foreach($fedSectors as &$fedSector) {
$sectorPlayers =& $fedSector->getPlayers();
foreach($sectorPlayers as &$sectorPlayer) {
foreach($fedSectors as $fedSector) {
$sectorPlayers = $fedSector->getPlayers();
foreach($sectorPlayers as $sectorPlayer) {
if($sectorPlayer->getRaceID() == $otherRaceID && $sectorPlayer->canBeProtectedByRace($raceID)) {
$currentlyParkedAccountIDs[$raceID][] = $sectorPlayer->getAccountID();
}
Expand All @@ -161,13 +161,13 @@ function checkPacts($race_id_1) {
if( count($currentlyParkedAccountIDs[$race_id_1]) + count($currentlyParkedAccountIDs[$race_id_2]) > 0 ) {
$expireTime = TIME + TIME_FOR_WAR_VOTE_FED_SAFETY;
$query = 'REPLACE INTO player_can_fed (account_id, game_id, race_id, expiry, allowed) VALUES ';
foreach($currentlyParkedAccountIDs as $raceID => &$accountIDs) {
foreach($currentlyParkedAccountIDs as $raceID => $accountIDs) {
if($raceID == $race_id_1)
$message = 'We have declared war upon your race';
else
$message = 'Your race has declared war upon us';
$message .= ', you have '.format_time(TIME_FOR_WAR_VOTE_FED_SAFETY).' to vacate our federal space, after that time you will no longer be protected (unless you have strong personal relations).';
foreach($accountIDs as &$accountID) {
foreach($accountIDs as $accountID) {
$query .= '('.$db2->escapeNumber($accountID).','.$db2->escapeNumber($player->getGameID()).','.$db2->escapeNumber($raceID).','.$db2->escapeNumber($expireTime).','.$db2->escapeBoolean(true).'),';
SmrPlayer::sendMessageFromRace($raceID, $player->getGameID(), $accountID, $message, $expireTime);
}
Expand Down

0 comments on commit 7a22cda

Please sign in to comment.