mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user