abundance 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/garden.rb +6 -3
  2. metadata +2 -2
data/lib/garden.rb CHANGED
@@ -74,7 +74,10 @@ class Garden
74
74
  when :crop
75
75
  @sprouts[data[:id]] = nil
76
76
  @crops[data[:id]] = data; socket_server_send(command,true,clientaddr,clientport)
77
- socket_server_send(command,data, @harvest[data[:id]][:clientaddr], @harvest[data[:id]][:clientport]) if @harvest[data[:id]]
77
+ if @harvest[data[:id]]
78
+ socket_server_send(command,data, @harvest[data[:id]][:clientaddr], @harvest[data[:id]][:clientport])
79
+ @crops[data[:id]] = @harvest[data[:id]] = nil
80
+ end
78
81
  when :growth
79
82
  case data
80
83
  when :progress
@@ -93,13 +96,13 @@ class Garden
93
96
  when :harvest
94
97
  case data
95
98
  when :all
96
- socket_server_send(command,{:seeds => @seeds, :sprouts => @sprouts.compact, :crops => @crops},clientaddr,clientport)
99
+ socket_server_send(command,{:seeds => @seeds, :sprouts => @sprouts.compact, :crops => @crops.compact},clientaddr,clientport)
97
100
  when :seed
98
101
  socket_server_send(command,@seeds,clientaddr,clientport)
99
102
  when :sprout
100
103
  socket_server_send(command,@sprouts.compact,clientaddr,clientport)
101
104
  when :crop
102
- socket_server_send(command,@crops,clientaddr,clientport)
105
+ socket_server_send(command,@crops.compact,clientaddr,clientport)
103
106
  @crops.clear
104
107
  else
105
108
  if data.is_a? Integer
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abundance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis-Philippe Perron
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-04 00:00:00 -05:00
12
+ date: 2008-12-05 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15