Skip to content

Commit

Permalink
fix terminalvelocity for scale=0
Browse files Browse the repository at this point in the history
  • Loading branch information
nfearnley committed May 27, 2024
1 parent 54cecb7 commit 00c476b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sizebot/lib/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ def bool_to_icon(value: bool) -> str:
body=lambda s: f"{s['terminalvelocity'].value:,.1M} per second\n({s['terminalvelocity'].value:,.1U} per second)" + ("\n*This user can safely fall from any height.*" if s["fallproof"].value else ""),
requires=["weight", "dragcoefficient"],
type=SV,
value=lambda v: math.sqrt((2 * GRAVITY * (v["weight"] / 1000)) / (v["dragcoefficient"] * AIR_DENSITY)),
value=lambda v: 0 if v["scale"] == 0 else (math.sqrt((2 * GRAVITY * (v["weight"] / 1000)) / (v["dragcoefficient"] * AIR_DENSITY))),
tags=["speed"],
aliases=["velocity", "fall"]),
StatDef("fallproof",
Expand Down

0 comments on commit 00c476b

Please sign in to comment.