diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 3fc6b0fa70c..6e3a6e44944 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -360,6 +360,13 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC var/list/map_size = splittext(sizes["mapwindow.size"], "x") + var/split_size = splittext(sizes["mainwindow.split.size"], "x") + var/split_width = text2num(split_size[1]) + + // Window is minimized, we can't get proper data so return to avoid division by 0 + if (!split_width) + return + // Gets the type of zoom we're currently using from our view datum // If it's 0 we do our pixel calculations based off the size of the mapwindow // If it's not, we already know how big we want our window to be, since zoom is the exact pixel ratio of the map @@ -381,9 +388,6 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC // Nothing to do return - var/split_size = splittext(sizes["mainwindow.split.size"], "x") - var/split_width = text2num(split_size[1]) - // Avoid auto-resizing the statpanel and chat into nothing. desired_width = min(desired_width, split_width - 300)