Per MSO's advice, Ceiling glide_size until BYOND supports floats

This commit is contained in:
MrPerson
2015-08-18 21:54:53 -07:00
parent b130f4958d
commit 51a17eeeac
+10 -2
View File
@@ -198,8 +198,16 @@
var/ticks = Ceiling(move_delay / world.tick_lag)
if(ticks <= 0)
ticks = 1
glide_size = world.icon_size / ticks //assume icons are square
mob.glide_size = glide_size
var/target_glide_size = world.icon_size / ticks
glide_size = target_glide_size
mob.glide_size = target_glide_size
//byond floor()'s glide_size, we want it to Ceiling(),
//but we don't want it to Ceiling() if they fix it to accept floating point numbers
if(glide_size != target_glide_size)
glide_size = Ceiling(target_glide_size)
mob.glide_size = glide_size
move_delay += world.time - 0.0001 //Ensure we're on the right tick even if there's rounding errors