species check was in the wrong place. fixed

This commit is contained in:
Emi Matchu 2011-01-27 17:50:08 -05:00
parent 8a36155994
commit b1015c9a5c

View file

@ -37,11 +37,11 @@ class Roulette
used_swf_asset_ids.push(swf_asset.id) used_swf_asset_ids.push(swf_asset.id)
swf_asset.object_asset_relationships.each do |rel| swf_asset.object_asset_relationships.each do |rel|
item = rel.item item = rel.item
pass = true if item.species_support_ids.empty? || item.species_support_ids.include?(@pet_type.species_id)
item.affected_zones.each do |zone| pass = true
checked_zone_id = zone.id item.affected_zones.each do |zone|
next if checked_zone_id == zone_id checked_zone_id = zone.id
if item.species_support_ids.empty? || item.species_support_ids.include?(@pet_type.species_id) next if checked_zone_id == zone_id
if i = unoccupied_zone_ids.find_index(zone_id) if i = unoccupied_zone_ids.find_index(zone_id)
unoccupied_zone_ids.delete zone_id unoccupied_zone_ids.delete zone_id
else else
@ -49,16 +49,13 @@ class Roulette
pass = false pass = false
break break
end end
else end
pass = false if pass
found_item = true
@item_ids << item.id
break break
end end
end end
if pass
found_item = true
@item_ids << item.id
break
end
end end
break if found_item break if found_item
end end