🐛 HealAPIでの補正の際に計算精度の影響で回復量が低下する問題を修正#2278
Conversation
There was a problem hiding this comment.
[IMO or MUST]
from_healer/push.mcfunction L21-23 辺りにてリストが float 定義されているのでこのままだと爆発する気がする。確認しておいて。
[WANT]
heal/.mcfunctionheal/modifier.mcfunction
辺りの@inputとか@outputは型が変わるんじゃないか? 確認しといてー。
[WANT]
heal/core/push_heal_events/.mcfunctionL17 :Amount.Over float 0.01 run scoreboard players get $OverHeal Temporaryheal/core/push_heal_events/from_healer/push.mcfunctionL24 :Amounts.Over[-1] ... float 0.01 run scoreboard players get $OverHeal Temporary
この辺りとかが float なのも、直感的にまずい気がするんだけど、どうかな?
|
説あるので直します |
| @@ -21,7 +21,7 @@ | |||
| data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Base append value -1f | |||
There was a problem hiding this comment.
これを見てください!
素晴らしいと思いませんか!?
要するに 1f と予め、float 型の数値が代入されている箇所もあるので見逃さないでー
There was a problem hiding this comment.
というか、これのせいで型不整合で代入できずに爆発する可能性が高い
| execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Over[-1] float 0.01 run scoreboard players get $OverHeal Temporary | ||
| data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].PreviousHealth append value -1f | ||
| execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Over[-1] double 0.01 run scoreboard players get $OverHeal Temporary | ||
| data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].PreviousHealth append value -1d |
There was a problem hiding this comment.
[MUST]
api: Health←data_get/health.mcfunction:13でDataCache.Data.Healthからset from
であるため、float 型のはず。
なのでコイツを変えてはならない。
double と float が混在するのはいささか気持ち悪いが……これ、大丈夫かなぁ。
There was a problem hiding this comment.
そ~いやHealthはfloatか~~~
どうしよう
There was a problem hiding this comment.
そもそも、double にしようとした理由ってどこの計算過程でバグが発生するからなんだ?
There was a problem hiding this comment.
ネクターの再生エフェクトを使ってて、回復量が4.2のはずが4.1になって、キモイな~~~~となった
There was a problem hiding this comment.
どこでそのズレが発生しているのかを調査した方が良さそう、知らんけど
There was a problem hiding this comment.
今のとこだけど、floatをスコアに変えるときに誤差が発生する
No description provided.