Make build mode not crash your client

If you right click on advanced build mode and then push cancel, or just push confirm without entering anything, it tries to build a list of every possible thing in the game, and usually crashes your client trying to display that list.

This makes it just not do anything if you don't give it an input. If you want to have a list of everything in the game you can probably still do that if you just enter / or whatever.
This commit is contained in:
VerySoft
2022-09-03 12:24:13 -04:00
parent c716f4f39b
commit 7ded949c51
+4 -1
View File
@@ -627,6 +627,9 @@
/obj/effect/bmode/buildmode/proc/get_path_from_partial_text(default_path)
var/desired_path = tgui_input_text(usr, "Enter full or partial typepath.","Typepath","[default_path]")
if(!desired_path) //VOREStation Add - If you don't give it anything it builds a list of every possible thing in the game and crashes your client.
return //VOREStation Add - And the main way for it to do that is to push the cancel button, which should just do nothing. :U
var/list/types = typesof(/atom)
var/list/matches = list()
@@ -705,4 +708,4 @@
#undef BUILDMODE_CONTENTS
#undef BUILDMODE_LIGHTS
#undef BUILDMODE_AI
#undef LAST_BUILDMODE
#undef LAST_BUILDMODE