From 75831e6707fb9498bc5bce1afaecc8e3e763a70c Mon Sep 17 00:00:00 2001 From: Ian Docherty Date: Mon, 3 Sep 2012 02:52:51 -0400 Subject: [PATCH] Bumped version and changes.txt --- bin/util/revamp_map.pl | 29 ++++++++++++++++------------- lib/Lacuna.pm | 2 +- var/www/public/changes.txt | 3 +++ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/bin/util/revamp_map.pl b/bin/util/revamp_map.pl index 65187690..3a386244 100644 --- a/bin/util/revamp_map.pl +++ b/bin/util/revamp_map.pl @@ -104,19 +104,22 @@ while (my $body = $bodies->next) { unless ($zone_news_cache{$zone}) { unless ($cache->get('revamp_news', $zone)) { - # This ensures that each time a zone receives a news item, it is 'corrupted' differently - my $seed = $body->x*10000+$body->y; - srand($seed); - - out("About to add news item"); - $body->add_news(100, $news_a); - $body->add_news(100, $news_b); - $body->add_news(100, corrupt_string(sprintf($news_1, rand(1000), $body->x, $body->y))); - $body->add_news(100, corrupt_string(sprintf($news_2, rand(10000)+80000))); - $body->add_news(100, corrupt_string(sprintf($news_3, rand(1000)))); - $body->add_news(100, corrupt_string(sprintf($news_4, rand(1000), $body->x, $body->y))); - $body->add_news(100, $news_c); - $cache->set('revamp_news', $zone, 1, 60 * 60 * 24 * 7); + # we can only 'add_news' to an occupied planet + if ($body->empire_id) { + # This ensures that each time a zone receives a news item, it is 'corrupted' differently + my $seed = $body->x*10000+$body->y; + srand($seed); + + out("About to add news item"); + $body->add_news(100, $news_a); + $body->add_news(100, $news_b); + $body->add_news(100, corrupt_string(sprintf($news_1, rand(1000), $body->x, $body->y))); + $body->add_news(100, corrupt_string(sprintf($news_2, rand(10000)+80000))); + $body->add_news(100, corrupt_string(sprintf($news_3, rand(1000)))); + $body->add_news(100, corrupt_string(sprintf($news_4, rand(1000), $body->x, $body->y))); + $body->add_news(100, $news_c); + $cache->set('revamp_news', $zone, 1, 60 * 60 * 24 * 7); + } } $zone_news_cache{$zone} = 1; } diff --git a/lib/Lacuna.pm b/lib/Lacuna.pm index 9df38bc4..bcae5928 100644 --- a/lib/Lacuna.pm +++ b/lib/Lacuna.pm @@ -7,7 +7,7 @@ use Config::JSON; useall __PACKAGE__; -our $VERSION = 3.0867; +our $VERSION = 3.0868; my $config = Config::JSON->new('/data/Lacuna-Server/etc/lacuna.conf'); my $db = Lacuna::DB->connect($config->get('db/dsn'),$config->get('db/username'),$config->get('db/password'), { mysql_enable_utf8 => 1}); diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 728d30da..ec9159d8 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,3 +1,6 @@ +3.0868: + - Fix: No longer try to send N19 news from an asteroid + 3.0867: - Add: Fissure. - Mod: BHG creates a Fissure instead of a Crater when it explodes. -- 2.51.2