-
Notifications
You must be signed in to change notification settings - Fork 0
Remove orphaned code and consolidate image generation utilities #1647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 15 commits
56bdd00
ce7d127
fd0c414
3bdc1d8
a6f1bfa
f94bf37
fca32fb
ef21a92
d8c9e35
3fd1233
d741c81
37ce7f7
9e6e461
d04b373
e3a8ea9
afd942f
b85df0b
5fb0327
f1671a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,7 +12,8 @@ import { | |||||
| clampPlayerFame, | ||||||
| calculateFameLevel, | ||||||
| clampBandHarmony, | ||||||
| clampNonNegative | ||||||
| clampNonNegative, | ||||||
| clamp0to100 | ||||||
| } from '../utils/gameStateUtils' | ||||||
| import type { RhythmSetlistEntry } from '../types/rhythmGame' | ||||||
| import type { | ||||||
|
|
@@ -96,22 +97,6 @@ export const createUpdatePlayerAction = ( | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Creates a band update action | ||||||
| * @param {Object} updates - Band state updates | ||||||
| * @returns {Object} Action object | ||||||
| */ | ||||||
| export const createUpdateVoidStressAction = ( | ||||||
| delta: number | ||||||
| ): Extract<GameAction, { type: typeof ActionTypes.UPDATE_VOID_STRESS }> => { | ||||||
| return { | ||||||
| type: ActionTypes.UPDATE_VOID_STRESS, | ||||||
| payload: { | ||||||
| delta: Number.isFinite(delta) ? delta : 0 | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| export const createUpdateBandAction = ( | ||||||
| updates: UpdateBandPayload | ||||||
| ): Extract<GameAction, { type: typeof ActionTypes.UPDATE_BAND }> => { | ||||||
|
|
@@ -448,7 +433,7 @@ export const createCompleteRoadieMinigameAction = ( | |||||
| > => ({ | ||||||
| type: ActionTypes.COMPLETE_ROADIE_MINIGAME, | ||||||
| payload: { | ||||||
| equipmentDamage: Math.max(0, Math.min(100, Number(equipmentDamage) || 0)), | ||||||
| equipmentDamage: clamp0to100(Number(equipmentDamage) || 0), | ||||||
| contrabandDelivered: Math.max(0, Number(contrabandDelivered) || 0) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with the adjacent 'equipmentDamage' field and the project's goal of consolidating clamping logic (as noted in the audit report D2), consider using the 'clampNonNegative' helper here instead of an inline 'Math.max' expression.
Suggested change
References
|
||||||
| } | ||||||
| }) | ||||||
|
|
||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since 'zealotryLevel' is an optional prop (number | undefined), passing it directly to 'clampZealotry' might cause issues if the helper expects a strict 'number'. Providing an explicit fallback ensures the UI renders correctly (e.g., 0%) when the value is missing.