diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 42ec1224746..a89ce04c0b7 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -114,18 +114,32 @@ Des: Removes all infected images from the alien. span_alertalien("[src] begins to twist and contort!"), span_noticealien("You begin to evolve!"), ) + new_xeno.setDir(dir) - if(numba && unique_name) - new_xeno.numba = numba - new_xeno.set_name() - if(!alien_name_regex.Find(name)) - new_xeno.name = name - new_xeno.real_name = real_name + new_xeno.change_name(name, real_name, numba) + if(mind) mind.name = new_xeno.real_name mind.transfer_to(new_xeno) + qdel(src) +/// Changes the name of the xeno we are evolving into in order to keep the same numerical identifier the old xeno had. +/mob/living/carbon/alien/proc/change_name(old_name, old_real_name, old_number) + if(!alien_name_regex.Find(old_name)) // check to make sure there's no admins doing funny stuff with naming these aliens + name = old_name + real_name = old_real_name + return + + if(!unique_name) + return + + if(old_number != 0) + numba = old_number + name = initial(name) // prevent chicanery like two different numerical identifiers tied to the same mob + + set_name() + /mob/living/carbon/alien/can_hold_items(obj/item/I) return (I && (I.item_flags & XENOMORPH_HOLDABLE || ISADVANCEDTOOLUSER(src)) && ..()) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 0ac1ac54f03..e5148c723a7 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1894,7 +1894,7 @@ GLOBAL_LIST_EMPTY(fire_appearances) user.put_in_hands(holder) /mob/living/proc/set_name() - if(!numba) + if(numba == 0) numba = rand(1, 1000) name = "[name] ([numba])" real_name = name