Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not sure cricket telecomms door should be named like this. #276

Open
Addust opened this issue Feb 25, 2022 · 2 comments
Open

not sure cricket telecomms door should be named like this. #276

Addust opened this issue Feb 25, 2022 · 2 comments

Comments

@Addust
Copy link
Contributor

Addust commented Feb 25, 2022

Issue reported from Round ID: 343 (Voidcrew-LRP)

Reporting client version: 514.1575

image

@GuiltyNeko
Copy link
Contributor

This still happens, just as a side-note.

@GuiltyNeko
Copy link
Contributor

/obj/structure/overmap/ship/simulated/proc/set_ship_name(new_name, ignore_cooldown = FALSE, bypass_same_name = FALSE)
if(bypass_same_name == FALSE)
if(!new_name || new_name == name)
return
if(!COOLDOWN_FINISHED(src, rename_cooldown))
return
if(name != initial(name))
priority_announce("The [name] has been renamed to the [new_name].", "Docking Announcement", sender_override = display_name, zlevel = shuttle.virtual_z())
message_admins("[key_name_admin(usr)] renamned vessel '[name]' to '[new_name]'")
name = new_name
shuttle.name = "[faction_prefix] [new_name]"
display_name = "[faction_prefix] [name]"
if(!ignore_cooldown)
COOLDOWN_START(src, rename_cooldown, 5 MINUTES)
for(var/area/shuttle_area as anything in shuttle.shuttle_areas)
shuttle_area.rename_area("[display_name] [initial(shuttle_area.name)]")
return TRUE

The line of note here is 372

shuttle_area.rename_area("[display_name] [initial(shuttle_area.name)]")

That leads into this proc, which leads into the next proc
/area/proc/rename_area(new_name)
var/prevname = "[name]"
set_area_machinery_title(src, new_name, prevname)
name = new_name
sortTim(GLOB.sortedAreas, /proc/cmp_name_asc)
return TRUE
/proc/set_area_machinery_title(area/A, title, oldtitle)
if(!oldtitle) // or replacetext goes to infinite loop
return
for(var/obj/machinery/airalarm/M in A)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/power/apc/M in A)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/components/unary/vent_scrubber/M in A)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/components/unary/vent_pump/M in A)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/door/M in A)
M.name = replacetext(M.name,oldtitle,title)

Without looking at replacetext, my best guess here is that it's taking the original name of the area, in the code, changing it to be "[ship name] [area name]" but it's also changing the names of various bits of equipment, in a way that searches for the exact original area name in the name of the machinery, and then placing the name of the ship directly in front of the name of the area it found on the door, ignoring any and all text before or after it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants