From 5ca1e05cf39805c5fe8157be86bfd67d3cc352c3 Mon Sep 17 00:00:00 2001 From: FalseIncarnate Date: Wed, 31 May 2017 17:11:44 -0400 Subject: [PATCH] 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. --- code/modules/fish/fishtank.dm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/modules/fish/fishtank.dm b/code/modules/fish/fishtank.dm index 34d393fad0c..c9c6108af8d 100644 --- a/code/modules/fish/fishtank.dm +++ b/code/modules/fish/fishtank.dm @@ -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