• R/O
  • SSH

提交

标签

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

A simple mod for the game "Factorio" that does what it's name implies.


Commit MetaInfo

修订版1bf0dea2d26dd7a4473f0f0c1dfa3da661f2d155 (tree)
时间2020-10-02 21:11:45
作者Eric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

Fix approx_eq to actually work.

更改概述

差异

diff -r 7362426f63a5 -r 1bf0dea2d26d control.lua
--- a/control.lua Thu Apr 30 08:43:11 2020 -0700
+++ b/control.lua Fri Oct 02 05:11:45 2020 -0700
@@ -40,8 +40,8 @@
4040 end
4141
4242 local function approx_eq(v1, v2, errscale)
43- offset = v2 * errscale
44- return ((v1 >= (v2 - offset)) and (v1 <= (v2 + offset)))
43+ offset = math.max(math.abs(v1 * errscale), math.abs(v2 * errscale))
44+ return math.abs(v1 - v2) <= offset
4545 end
4646
4747 local function on_hotkey(event)