Fixes non-crossbreeding fish only laying duds

Shrimp and electric eels will now properly lay eggs of their type if
another of their species is in the tank with them. They will lay duds if
they are the only one of their species present as normal, or if another
fish attempts to crossbreed with them.
This commit is contained in:
FalseIncarnate
2017-05-31 17:11:44 -04:00
parent ccf1b9ea0d
commit 5ca1e05cf3
+7 -3
View File
@@ -369,14 +369,18 @@
/obj/machinery/fishtank/proc/breed_fish()
var/list/breed_candidates = fish_list.Copy()
var/datum/fish/parent1 = pick_n_take(breed_candidates)
var/datum/fish/parent2 = null
if(!parent1.crossbreeder) //fish with crossbreed = 0 will only breed with their own species, and only leave duds if they can't breed
if(parent1 in breed_candidates)
var/match_found = 0
for(var/datum/fish/possible in breed_candidates)
if(parent1.type == possible.type)
match_found = 1
break
if(match_found)
egg_list.Add(parent1.egg_item)
else
egg_list.Add(/obj/item/fish_eggs)
else
parent2 = pick(breed_candidates)
var/datum/fish/parent2 = pick(breed_candidates)
if(!parent2.crossbreeder) //second fish refuses to crossbreed, spawn a dud
egg_list.Add(/obj/item/fish_eggs)
else if(parent1 == parent2) //both fish are the same type