Permalink
Browse files

Fix crash bug in show_planet when production is 0.

  • Loading branch information...
T. Alexander Popiel
T. Alexander Popiel committed Jan 2, 2011
1 parent 75d4607 commit 1486c2790280f8f976b2e85c2143ef6d109d945b
Showing with 4 additions and 1 deletion.
  1. +4 −1 show_planet
View
@@ -158,7 +158,10 @@ sub resource_info {
push(@list, $body->{"${resource}_stored"});
push(@list, $body->{"${resource}_capacity"});
push(@list, $body->{"${resource}_hour"});
- if ($list[2] > 0) {
+ if ($list[2] == 0) {
+ push(@list, "stable");
+ push(@list, format_time($status->{_time}));
+ } elsif ($list[2] > 0) {
push(@list, "full");
push(@list, format_time(($list[1] - $list[0]) / $list[2] * 3600 + $status->{_time}));
} else {

0 comments on commit 1486c27

Please sign in to comment.