refactor: disposition alter functions to return strings#1240
Conversation
There was a problem hiding this comment.
3 issues found across 2 files
Confidence score: 2/5
- In
scripts/scr_ChapterTraits/scr_ChapterTraits.gml,array_create(14, struct)makes allfaction_disp_modsentries point to the same struct, somerge_modscan overwrite every faction with identicalint_mod/multvalues and cause broad gameplay regressions — initialize each array slot with a distinct struct before merging. - In
scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml, a string template is missing the$prefix, so{}placeholders will render literally and show broken text to players — add the$so interpolation occurs as intended. - In
scripts/scr_ChapterTraits/scr_ChapterTraits.gml, the newstringsfield is currently unused and not merged, which adds confusing dead state (and currently inherits the same shared-reference risk) — either wire it into merge/use paths or remove it in this PR to reduce follow-on bugs.
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Shadow auto-approve: would require human review. Refactors core disposition logic, altering bounds from -100..100 to 0..100 and adding string return capabilities. Even though it's a single file, this changes how disposition values are calculated and stored, which could break any code relying on the old range or behavior.
Re-trigger cubic
|
This PR is marked as stale, because it has been open for 7 days with no activity. |
|
I've fixed an error on |
Summary by cubic
Refactored disposition helpers to optionally return formatted messages and centralized bounds so dispositions stay within 0–100.
Refactors
alter_disposition(faction, value, return_string=false)andalter_dispositions(alterations, return_strings)can return strings ("Faction Name : +/-N");faction_disp_modsnow includesstrings: [].calc_final_disp_valueto keep results in 0–100;alter_dispositiononly applies the adjusted delta.Migration
alter_dispositionclamping. Use thereturn_string(s)flags if you need messages.Written for commit 60558ab. Summary will update on new commits.