From afbd96dc7350edec831e12e7a40a2b3ad00a9343 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 24 Sep 2018 20:18:31 +0100 Subject: [PATCH 1/2] Checking crops revertTo status --- util/crops.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/crops.go b/util/crops.go index 8d461de..503cb99 100644 --- a/util/crops.go +++ b/util/crops.go @@ -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 { go c.RunUpdateLoop() return true } From 6ea497428d2852aca257f4fca0ae27ca390979ec Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 24 Sep 2018 20:45:04 +0100 Subject: [PATCH 2/2] Removed log lines --- build.sh | 0 util/field.go | 4 ---- 2 files changed, 4 deletions(-) mode change 100644 => 100755 build.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 diff --git a/util/field.go b/util/field.go index 4db17e9..6c2d91a 100644 --- a/util/field.go +++ b/util/field.go @@ -2,7 +2,6 @@ package util import ( "fmt" - "log" "github.com/faiface/pixel" "github.com/faiface/pixel/pixelgl" @@ -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) } }