Skip to content

Commit

Permalink
Fix simple animals babymaking
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhEugene committed Oct 28, 2023
1 parent b11415f commit 7c47a8d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions code/modules/mob/living/simple_animal/simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,18 @@
collar_type = "[initial(collar_type)]"
regenerate_icons()

/mob/living/simple_animal/proc/check_if_child(mob/possible_child)
for(var/childpath in childtype)
if (istype(possible_child, childpath))
return TRUE
return FALSE

/mob/living/simple_animal/proc/make_babies() // <3 <3 <3
if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || !SSticker.IsRoundInProgress())
return FALSE

if (check_if_child(src)) // Children aren't fertile enough
return FALSE
next_scan_time = world.time + 400

var/alone = TRUE
Expand All @@ -465,12 +474,12 @@
for(var/mob/M in oview(7, src))
if(M.stat != CONSCIOUS) //Check if it's conscious FIRST.
continue
else if(istype(M, childtype)) //Check for children SECOND.
else if(check_if_child(M)) //Check for children SECOND.
children++
else if(istype(M, animal_species))
if(M.ckey)
continue
else if(!istype(M, childtype) && M.gender == MALE) //Better safe than sorry ;_;
else if(!check_if_child(M) && M.gender == MALE) //Better safe than sorry ;_;
partner = M
else if(isliving(M) && !faction_check_mob(M)) //shyness check. we're not shy in front of things that share a faction with us.
return //we never mate when not alone, so just abort early
Expand Down

0 comments on commit 7c47a8d

Please sign in to comment.