diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index c494fd685e..ae0f7f4c47 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -240,7 +240,8 @@ var/obj/screen/robot_inventory var/display_rows = -round(-(r.module.modules.len) / 8) r.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7" - r.client.screen += r.robot_modules_background + if(r.client) + r.client.screen += r.robot_modules_background var/x = -4 //Start at CENTER-4,SOUTH+1 var/y = 1 @@ -258,7 +259,7 @@ var/obj/screen/robot_inventory r.module.modules.Remove(r.module.emag) for(var/atom/movable/A in r.module.modules) - if( (A != r.module_state_1) && (A != r.module_state_2) && (A != r.module_state_3) ) + if(r.client && (A != r.module_state_1) && (A != r.module_state_2) && (A != r.module_state_3) ) //Module is not currently active r.client.screen += A if(x < 0) @@ -276,11 +277,12 @@ var/obj/screen/robot_inventory //Modules display is hidden //r.client.screen -= robot_inventory //"store" icon for(var/atom/A in r.module.modules) - if( (A != r.module_state_1) && (A != r.module_state_2) && (A != r.module_state_3) ) + if(r.client && (A != r.module_state_1) && (A != r.module_state_2) && (A != r.module_state_3) ) //Module is not currently active r.client.screen -= A r.shown_robot_modules = 0 - r.client.screen -= r.robot_modules_background + if(r.client) + r.client.screen -= r.robot_modules_background /mob/living/silicon/robot/update_hud() if(modtype)