diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 18ff612d9a..ba2e7afcb2 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -678,9 +678,11 @@ var/datum/planet/planet = tgui_input_list(usr, "Which planet do you want to modify time on?", "Change Time", SSplanets.planets) if(istype(planet)) var/datum/time/current_time_datum = planet.current_time - var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), 23) + var/planet_hours = max(round(current_time_datum.seconds_in_day / 36000) - 1, 0) + var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), planet_hours) if(!isnull(new_hour)) - var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), 59) + var/planet_minutes = max(round(current_time_datum.seconds_in_hour / 600) - 1, 0) + var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), planet_minutes) if(!isnull(new_minute)) var/type_needed = current_time_datum.type var/datum/time/new_time = new type_needed() diff --git a/code/modules/projectiles/broken.dm b/code/modules/projectiles/broken.dm index 6d90e68fef..3eda477814 100644 --- a/code/modules/projectiles/broken.dm +++ b/code/modules/projectiles/broken.dm @@ -98,34 +98,37 @@ /obj/item/broken_gun/proc/can_repair_with(obj/item/I, mob/user) for(var/path in material_needs) - if(ispath(path) && istype(I, path)) - if(material_needs[path] > 0) - if(istype(I, /obj/item/stack)) - var/obj/item/stack/S = I - if(S.can_use(material_needs[path])) - return TRUE - else - to_chat(user, span_notice("You do not have enough [path] to continue repairs.")) - else - return TRUE - + if(!ispath(path) || !istype(I, path)) + continue + if(material_needs[path] <= 0) + continue + if(istype(I, /obj/item/stack)) + var/obj/item/stack/S = I + if(S.can_use(material_needs[path])) + return TRUE + else + to_chat(user, span_notice("You do not have enough [I] to continue repairs.")) + else + return TRUE return FALSE /obj/item/broken_gun/proc/repair_with(obj/item/I, mob/user) for(var/path in material_needs) - if(ispath(path) && istype(I, path)) - if(material_needs[path] > 0) - if(istype(I, /obj/item/stack)) - var/obj/item/stack/S = I - if(S.can_use(material_needs[path])) - S.use(material_needs[path]) - material_needs[path] = 0 - to_chat(user, span_notice("You repair some damage on \the [src] with \the [S].")) - else - material_needs[path] = max(0, material_needs[path] - 1) - user.drop_from_inventory(I) - to_chat(user, span_notice("You repair some damage on \the [src] with \the [I].")) - qdel(I) + if(!ispath(path) || !istype(I, path)) + continue + if(material_needs[path] <= 0) + continue + if(istype(I, /obj/item/stack)) + var/obj/item/stack/S = I + if(S.can_use(material_needs[path])) + S.use(material_needs[path]) + material_needs[path] = 0 + to_chat(user, span_notice("You repair some damage on \the [src] with \the [S].")) + else + material_needs[path] = max(0, material_needs[path] - 1) + user.drop_from_inventory(I) + to_chat(user, span_notice("You repair some damage on \the [src] with \the [I].")) + qdel(I) check_complete_repair(user)