From ae64bd1adaefa00c49c58341558920efc44775d5 Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Thu, 11 Jan 2024 01:31:23 -0500 Subject: [PATCH] FLOOR(x, 1) to Floor() replace FLOOR(x, 1) use with simpler Floor() define, in 515 all Floor() use can be replaced by native floor() --- code/__HELPERS/_time.dm | 6 +++--- code/controllers/subsystem/minimap.dm | 4 ++-- code/game/machinery/computer/research.dm | 2 +- code/game/objects/items/fulton.dm | 4 ++-- code/modules/buildmode/buildmode.dm | 2 +- code/modules/clothing/suits/marine_armor.dm | 2 +- code/modules/mob/dead/observer/orbit.dm | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/__HELPERS/_time.dm b/code/__HELPERS/_time.dm index 3b918c166eb7..733ca659501b 100644 --- a/code/__HELPERS/_time.dm +++ b/code/__HELPERS/_time.dm @@ -91,21 +91,21 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0) return "right now" if(second < 60) return "[second] second[(second != 1)? "s":""]" - var/minute = FLOOR(second / 60, 1) + var/minute = Floor(second / 60) second = FLOOR(MODULUS(second, 60), round_seconds_to) var/secondT if(second) secondT = " and [second] second[(second != 1)? "s":""]" if(minute < 60) return "[minute] minute[(minute != 1)? "s":""][secondT]" - var/hour = FLOOR(minute / 60, 1) + var/hour = Floor(minute / 60) minute = MODULUS(minute, 60) var/minuteT if(minute) minuteT = " and [minute] minute[(minute != 1)? "s":""]" if(hour < 24) return "[hour] hour[(hour != 1)? "s":""][minuteT][secondT]" - var/day = FLOOR(hour / 24, 1) + var/day = Floor(hour / 24) hour = MODULUS(hour, 24) var/hourT if(hour) diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index f3b141c0d9f8..3255c7db2fc5 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -88,8 +88,8 @@ SUBSYSTEM_DEF(minimaps) else if(yval < smallest_y) smallest_y = yval - minimaps_by_z["[level]"].x_offset = FLOOR((SCREEN_PIXEL_SIZE-largest_x-smallest_x) / MINIMAP_SCALE, 1) - minimaps_by_z["[level]"].y_offset = FLOOR((SCREEN_PIXEL_SIZE-largest_y-smallest_y) / MINIMAP_SCALE, 1) + minimaps_by_z["[level]"].x_offset = Floor((SCREEN_PIXEL_SIZE-largest_x-smallest_x) / MINIMAP_SCALE) + minimaps_by_z["[level]"].y_offset = Floor((SCREEN_PIXEL_SIZE-largest_y-smallest_y) / MINIMAP_SCALE) icon_gen.Shift(EAST, minimaps_by_z["[level]"].x_offset) icon_gen.Shift(NORTH, minimaps_by_z["[level]"].y_offset) diff --git a/code/game/machinery/computer/research.dm b/code/game/machinery/computer/research.dm index 1ba696eeee9c..d5158cb76451 100644 --- a/code/game/machinery/computer/research.dm +++ b/code/game/machinery/computer/research.dm @@ -179,7 +179,7 @@ if("purchase_document") if(!photocopier) return - var/purchase_tier = FLOOR(text2num(params["purchase_document"]), 1) + var/purchase_tier = Floor(text2num(params["purchase_document"])) if(purchase_tier <= 0 || purchase_tier > 5) return if(purchase_tier > GLOB.chemical_data.clearance_level) diff --git a/code/game/objects/items/fulton.dm b/code/game/objects/items/fulton.dm index 788613cf4c6e..e36d269c8b90 100644 --- a/code/game/objects/items/fulton.dm +++ b/code/game/objects/items/fulton.dm @@ -141,8 +141,8 @@ GLOBAL_LIST_EMPTY(deployed_fultons) original_location = get_turf(attached_atom) playsound(loc, 'sound/items/fulton.ogg', 50, 1) reservation = SSmapping.RequestBlockReservation(3, 3, turf_type_override = /turf/open/space) - var/middle_x = reservation.bottom_left_coords[1] + FLOOR((reservation.top_right_coords[1] - reservation.bottom_left_coords[1]) / 2, 1) - var/middle_y = reservation.bottom_left_coords[2] + FLOOR((reservation.top_right_coords[2] - reservation.bottom_left_coords[2]) / 2, 1) + var/middle_x = reservation.bottom_left_coords[1] + Floor((reservation.top_right_coords[1] - reservation.bottom_left_coords[1]) / 2) + var/middle_y = reservation.bottom_left_coords[2] + Floor((reservation.top_right_coords[2] - reservation.bottom_left_coords[2]) / 2) var/turf/space_tile = locate(middle_x, middle_y, reservation.bottom_left_coords[3]) if(!space_tile) visible_message(SPAN_WARNING("[src] begins beeping like crazy. Something is wrong!")) diff --git a/code/modules/buildmode/buildmode.dm b/code/modules/buildmode/buildmode.dm index eeab65ec031a..bc20a714027d 100644 --- a/code/modules/buildmode/buildmode.dm +++ b/code/modules/buildmode/buildmode.dm @@ -80,7 +80,7 @@ var/pos_idx = 0 for(var/thing in elements) var/x = pos_idx % switch_width - var/y = FLOOR(pos_idx / switch_width, 1) + var/y = Floor(pos_idx / switch_width) var/atom/movable/screen/buildmode/B = new buttontype(src, thing) // extra .5 for a nice offset look B.screen_loc = "NORTH-[(1 + 0.5 + y*1.5)],WEST+[0.5 + x*1.5]" diff --git a/code/modules/clothing/suits/marine_armor.dm b/code/modules/clothing/suits/marine_armor.dm index b79c0dcb9912..afefa2903ab4 100644 --- a/code/modules/clothing/suits/marine_armor.dm +++ b/code/modules/clothing/suits/marine_armor.dm @@ -190,7 +190,7 @@ if(. != CHECKS_PASSED) return set_light_range(initial(light_range)) - set_light_power(FLOOR(initial(light_power) * 0.5, 1)) + set_light_power(Floor(initial(light_power) * 0.5)) set_light_on(toggle_on) flags_marine_armor ^= ARMOR_LAMP_ON diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm index 50496cef31c5..bad8e74d4ff1 100644 --- a/code/modules/mob/dead/observer/orbit.dm +++ b/code/modules/mob/dead/observer/orbit.dm @@ -110,7 +110,7 @@ if(isliving(M)) var/mob/living/player = M - serialized["health"] = FLOOR((player.health / player.maxHealth * 100), 1) + serialized["health"] = Floor(player.health / player.maxHealth * 100) if(isxeno(player)) var/mob/living/carbon/xenomorph/xeno = player @@ -126,7 +126,7 @@ var/obj/item/card/id/id_card = human.get_idcard() var/datum/species/human_species = human.species var/max_health = human_species.total_health != human.maxHealth ? human_species.total_health : human.maxHealth - serialized["health"] = FLOOR((player.health / max_health * 100), 1) + serialized["health"] = Floor(player.health / max_health * 100) serialized["job"] = id_card?.assignment ? id_card.assignment : human.job serialized["nickname"] = human.real_name