fix: match scenario 2601 monthly seed progression
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// MariaDB FLOAT stores binary32, but its text protocol exposes only six
|
||||
// significant decimal digits. Ref reads that text into PHP before every
|
||||
// command/battle update, so both boundaries are part of the game state.
|
||||
export const toLegacyStoredFloat = (value: number): number => Math.fround(value);
|
||||
|
||||
export const readLegacyStoredFloat = (value: number): number =>
|
||||
Number(Math.fround(value).toPrecision(6));
|
||||
|
||||
export const addLegacyStoredFloat = (current: number, delta: number): number =>
|
||||
toLegacyStoredFloat(readLegacyStoredFloat(current) + delta);
|
||||
Reference in New Issue
Block a user