Skip to content

Adjust some nullpo checks#3378

Open
MrKeiKun wants to merge 2 commits into
HerculesWS:masterfrom
MrKeiKun:fix-2973-nullpo-checks
Open

Adjust some nullpo checks#3378
MrKeiKun wants to merge 2 commits into
HerculesWS:masterfrom
MrKeiKun:fix-2973-nullpo-checks

Conversation

@MrKeiKun
Copy link
Copy Markdown
Contributor

@MrKeiKun MrKeiKun commented Aug 30, 2025

Pull Request Prelude

Changes Proposed

Issues addressed:
#2973
#2847 (probably?)

…egen_pc.

Signed-off-by: Lorenzo Buitizon <the.keikun@gmail.com>
@MrKeiKun MrKeiKun changed the title Adjust some nullpo check on status_calc_regen_pc and status_calc_regen_rate_pc Adjust some nullpo checks Aug 30, 2025
Signed-off-by: Lorenzo Buitizon <the.keikun@gmail.com>
@MrKeiKun MrKeiKun force-pushed the fix-2973-nullpo-checks branch from 49350d4 to f4dbee7 Compare August 31, 2025 15:40
Comment thread src/map/status.c
nullpo_retv(regen->sitting);
nullpo_retv(regen->skill);

if (regen->skill == NULL)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original design here is that regen->skill, regen->sitting should never be null, but now you're defaulting to make it sd is there a rationale behind it? the commit messages doesn't give a rationale at all or explain how it fixes this issue, this seem more like a band-aid workaround than an actual fix for the issue mentioned.

Comment thread src/map/status.c
struct regen_data_sub *skill_regen = regen->skill;
skill_regen->hp = 0;
skill_regen->sp = 0;
if (regen->skill != NULL) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It cannot be null still with your check this is redundant.

@hemagx hemagx added this to the Release v2026.05 milestone May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants