FILES ----- scripts\rect.lua scripts\util.lua scripts\vec2.lua stats\effects\bed\bed.lua DIFFS ----- scripts\rect.lua 15a16,23 > function rect.ll(rectangle) > return {rectangle[1], rectangle[2]} > end > > function rect.ur(rectangle) > return {rectangle[3], rectangle[4]} > end > 17,20c25,28 < local first = {rectangle[1], rectangle[2]} < local second = {rectangle[3], rectangle[4]} < first = vec2.rotate(first, angle) < second = vec2.rotate(second, angle) --- > local ll = rect.ll(rectangle) > local ur = rect.ur(rectangle) > ll = vec2.rotate(ll, angle) > ur = vec2.rotate(ur, angle) 23,24c31,32 < math.min(first[1], second[1]), math.min(first[2], second[2]), < math.max(first[1], second[1]), math.max(first[2], second[2]) --- > math.min(ll[1], ur[1]), math.min(ll[2], ur[2]), > math.max(ll[1], ur[1]), math.max(ll[2], ur[2]) 45a54,60 > end > > function rect.contains(rectangle, point) > return point[1] >= rectangle[1] > and point[2] >= rectangle[2] > and point[1] <= rectangle[3] > and point[2] <= rectangle[4] scripts\util.lua 463,464c463,464 < local startAngle = math.pi*2 / sections * (i-1) < local endAngle = math.pi*2 / sections * i --- > local startAngle = math.pi * 2 / sections * (i-1) > local endAngle = math.pi * 2 / sections * i scripts\vec2.lua 112,118c112,117 < function vec2.rotateRect(rect, angle) < local ll = vec2.rotate({rect[1], rect[2]}, angle) < local ur = vec2.rotate({rect[3], rect[4]}, angle) < if ll[1] > ur[1] then ll[1], ur[1] = ur[1], ll[1] end < if ll[2] > ur[2] then ll[2], ur[2] = ur[2], ll[2] end < return {ll[1], ll[2], ur[1], ur[2]} < end \ No newline at end of file --- > function vec2.approach(vector, target, rate) > return { > target[1] > vector[1] and math.min(vector[1] + rate, target[1]) or math.max(vector[1] - rate, target[1]), > target[2] > vector[2] and math.min(vector[2] + rate, target[2]) or math.max(vector[2] - rate, target[2]) > } > end stats\effects\bed\bed.lua 1c1 < require "/scripts/vec2.lua" --- > require "/scripts/rect.lua" 6c6 < animator.setParticleEmitterOffsetRegion("healing", vec2.rotateRect(mcontroller.boundBox(), mcontroller.rotation())) --- > animator.setParticleEmitterOffsetRegion("healing", rect.rotate(mcontroller.boundBox(), mcontroller.rotation()))