Skip to content

Commit

Permalink
fix(mcfish): 使用美西螈钓鱼,吞鱼异常的问题
Browse files Browse the repository at this point in the history
fishInfo.Number = 0 位置不对,导致海豚和鳕鱼都吃了100条。会一直吃到某种鱼数量够为止,并且前面数量不够的鱼都白吃了
  • Loading branch information
vatebur committed Aug 8, 2024
1 parent 33a5d0a commit feba2ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugin/mcfish/fish.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func init() {
fishNumber = 0
for name, number := range fishNmaes {
fishNumber += number
msg += strconv.Itoa(number) + name + ""
msg += strconv.Itoa(number) + name + " "
}
msg += ")"
fishNumber /= 2
Expand Down
2 changes: 1 addition & 1 deletion plugin/mcfish/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ func (sql *fishdb) pickFishFor(uid int64, number int) (fishNames map[string]int,
}
if fishInfo.Number < i {
k++
fishInfo.Number = 0
i -= fishInfo.Number
fishNames[fishInfo.Name] += fishInfo.Number
fishInfo.Number = 0
} else {
fishNames[fishInfo.Name] += i
fishInfo.Number -= i
Expand Down

0 comments on commit feba2ff

Please sign in to comment.