Mercurial > eagle-eye
comparison sheep.pl @ 11:e21b8f303c6a
fixed the ally counting
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Wed, 08 Oct 2008 10:04:54 +0800 |
parents | f590b5ea5e55 |
children | e68f4cadfabd |
comparison
equal
deleted
inserted
replaced
10:f590b5ea5e55 | 11:e21b8f303c6a |
---|---|
38 my ($x, $y) = @ARGV; | 38 my ($x, $y) = @ARGV; |
39 | 39 |
40 listSheeps(Ikariam::User->search_sheeps(($x + 6), ($x - 6), ($y + 6), ($y - 6))); | 40 listSheeps(Ikariam::User->search_sheeps(($x + 6), ($x - 6), ($y + 6), ($y - 6))); |
41 listSheeps(Ikariam::User->search_inactivity(($x + 6), ($x - 6), ($y + 6), ($y - 6))); | 41 listSheeps(Ikariam::User->search_inactivity(($x + 6), ($x - 6), ($y + 6), ($y - 6))); |
42 | 42 |
43 | |
44 sub listSheeps | 43 sub listSheeps |
45 { | 44 { |
46 my @sheeps = @_; | 45 my @sheeps = @_; |
47 | 46 |
48 my $s; | 47 my $s; |
53 # 假期模式 | 52 # 假期模式 |
54 next if($sheep->status eq 'v'); | 53 next if($sheep->status eq 'v'); |
55 | 54 |
56 # 查聯盟數量 | 55 # 查聯盟數量 |
57 my $members = 1; | 56 my $members = 1; |
58 unless ($sheep->status eq 'i') { | 57 unless ($sheep->status eq 'i' || $sheep->allyId == '0') { |
59 $members = Ikariam::User->search(allyId => $sheep->allyId)->count(); | 58 $members = Ikariam::User->search(allyId => $sheep->allyId)->count(); |
60 next if($members > 3); | 59 next if($members > 3); |
61 } | 60 } |
62 | 61 |
63 # print Dumper($sheep->_data_hash); | 62 # print Dumper($sheep->_data_hash); |