Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified build.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion util/crops.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func NewCrop(name string) *Crop {
// Otherwise it just returns false
func (c *Crop) Revert() bool {
c.stage = c.revertTo
if c.revertTo < 0 {
if c.revertTo == 0 {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check https://github.com/bcvery1/Deadication/blob/master/util/crops.go#L37 "Apple trees" revert to stage 3, not 0. This line will not work. We actually want to check if c.revertTo > -1 (originally it was <)

go c.RunUpdateLoop()
return true
}
Expand Down
4 changes: 0 additions & 4 deletions util/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package util

import (
"fmt"
"log"

"github.com/faiface/pixel"
"github.com/faiface/pixel/pixelgl"
Expand Down Expand Up @@ -48,13 +47,10 @@ func InitFields() {
func (f *field) harvest() {
// Decrement amount of crops left
f.amountLeft--
log.Println(f.amountLeft)

if f.amountLeft == 0 {
log.Println(f.planted)
// If the plant reverts, field is still planted
f.planted = f.crop.Revert()
log.Println(f.planted)
}
}

Expand Down