Skip to content

Commit

Permalink
CEILING(x, 1) to Ceiling()
Browse files Browse the repository at this point in the history
replace CEILING(x, 1) use with simpler Ceiling() define, in 515 all Ceiling() use can be replaced by native ceiling()
  • Loading branch information
Doubleumc committed Jan 11, 2024
1 parent 8ff5e63 commit 8fab189
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion code/__HELPERS/_time.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0)
return gameTimestamp("mm:ss", time)

/proc/time_left_until(target_time, current_time, time_unit)
return CEILING(target_time - current_time, 1) / time_unit
return Ceiling(target_time - current_time) / time_unit

/proc/text2duration(text = "00:00") // Attempts to convert time text back to time value
var/split_text = splittext(text, ":")
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ GLOBAL_LIST_INIT(WALLITEMS, list(
. = 0
var/i = DS2TICKS(initial_delay)
do
. += CEILING(i*DELTA_CALC, 1)
. += Ceiling(i*DELTA_CALC)
sleep(i*world.tick_lag*DELTA_CALC)
i *= 2
while (TICK_USAGE > min(TICK_LIMIT_TO_RUN, Master.current_ticklimit))
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/timer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ SUBSYSTEM_DEF(timer)
be supported and may refuse to run or run with a 0 wait")

if (flags & TIMER_CLIENT_TIME) // REALTIMEOFDAY has a resolution of 1 decisecond
wait = max(CEILING(wait, 1), 1) // so if we use tick_lag timers may be inserted in the "past"
wait = max(Ceiling(wait), 1) // so if we use tick_lag timers may be inserted in the "past"
else
wait = max(CEILING(wait, world.tick_lag), world.tick_lag)

Expand Down
4 changes: 2 additions & 2 deletions code/datums/beam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@
//Position the effect so the beam is one continous line
var/a
if(abs(Pixel_x)>world.icon_size)
a = Pixel_x > 0 ? round(Pixel_x/32) : CEILING(Pixel_x/world.icon_size, 1)
a = Pixel_x > 0 ? round(Pixel_x/32) : Ceiling(Pixel_x/world.icon_size)
X.x += a
Pixel_x %= world.icon_size
if(abs(Pixel_y)>world.icon_size)
a = Pixel_y > 0 ? round(Pixel_y/32) : CEILING(Pixel_y/world.icon_size, 1)
a = Pixel_y > 0 ? round(Pixel_y/32) : Ceiling(Pixel_y/world.icon_size)
X.y += a
Pixel_y %= world.icon_size

Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/overlay_lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
turn_off()
range = clamp(CEILING(new_range, 0.5), 1, 7)
var/pixel_bounds = ((range - 1) * 64) + 32
lumcount_range = CEILING(range, 1)
lumcount_range = Ceiling(range)
if(current_holder && overlay_lighting_flags & LIGHTING_ON)
current_holder.underlays -= visible_mask
visible_mask.icon = light_overlays["[pixel_bounds]"]
Expand Down
2 changes: 1 addition & 1 deletion code/modules/lighting/lighting_mask/shadow_calculator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
SSlighting.total_shadow_calculations ++

//Ceiling the range since we need it in integer form
var/range = CEILING(radius, 1)
var/range = Ceiling(radius)
DO_SOMETHING_IF_DEBUGGING_SHADOWS(var/timer = TICK_USAGE)

//Work out our position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@
var/list/turf/turfs = list()
if (source_turf)
var/oldlum = source_turf.luminosity
source_turf.luminosity = CEILING(light_range, 1)
for(var/turf/T in view(CEILING(light_range, 1), source_turf))
source_turf.luminosity = Ceiling(light_range)
for(var/turf/T in view(Ceiling(light_range), source_turf))
if(!IS_OPAQUE_TURF(T))
if (!T.lighting_corners_initialised)
T.static_generate_missing_corners()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
return

var/health_threshold
health_threshold = max(CEILING((health * 4) / (maxHealth), 1), 0) //From 0 to 4, in 25% chunks
health_threshold = max(Ceiling((health * 4) / (maxHealth)), 0) //From 0 to 4, in 25% chunks
if(health > HEALTH_THRESHOLD_DEAD)
if(health_threshold > 3)
wound_icon_holder.icon_state = "none"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/living_health_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@

switch(client.prefs?.pain_overlay_pref_level)
if(PAIN_OVERLAY_IMPAIR)
overlay_fullscreen("eye_blur", /atom/movable/screen/fullscreen/impaired, CEILING(clamp(eye_blurry * 0.3, 1, 6), 1))
overlay_fullscreen("eye_blur", /atom/movable/screen/fullscreen/impaired, Ceiling(clamp(eye_blurry * 0.3, 1, 6)))
if(PAIN_OVERLAY_LEGACY)
overlay_fullscreen("eye_blur", /atom/movable/screen/fullscreen/blurry)
else // PAIN_OVERLAY_BLURRY
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/hostile/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

wound_icon_holder.layer = layer + 0.01
wound_icon_holder.dir = dir
var/health_threshold = max(CEILING((health * 4) / (maxHealth), 1), 0) //From 0 to 4, in 25% chunks
var/health_threshold = max(Ceiling((health * 4) / (maxHealth)), 0) //From 0 to 4, in 25% chunks
if(health > HEALTH_THRESHOLD_DEAD)
if(health_threshold > 3)
wound_icon_holder.icon_state = "none"
Expand Down

0 comments on commit 8fab189

Please sign in to comment.