diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index a005d0733c1..0f6b28b3c1c 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -364,6 +364,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 @@ -385,9 +392,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)