Skip to content

ASD/ARC: Fix Error by One in gasCan Vector#472

Merged
rftrdev merged 3 commits into
1dot13:masterfrom
BeatAroundTheBuscher:fix_asd_off_by_one
Aug 16, 2025
Merged

ASD/ARC: Fix Error by One in gasCan Vector#472
rftrdev merged 3 commits into
1dot13:masterfrom
BeatAroundTheBuscher:fix_asd_off_by_one

Conversation

@BeatAroundTheBuscher
Copy link
Copy Markdown
Contributor

@BeatAroundTheBuscher BeatAroundTheBuscher commented Jul 28, 2025

The ARC mission DISRUPT_ASD_STEAL_FUEL crashes the game at 00:00. Inside ApplyAdditionalASDEffects the vector ItemIdCache::gasCans is indexed by .size() which returns the size of 1. But since indexes start at 0 the game tries to access memory that isn't reserved for this vector.

@BeatAroundTheBuscher BeatAroundTheBuscher changed the title ASD/ARC: Fix Error by One in gasCan Vector, set breaks correctly, add indent ASD/ARC: Fix Error by One in gasCan Vector Jul 29, 2025
Copy link
Copy Markdown
Contributor

@rftrdev rftrdev left a comment

Choose a reason for hiding this comment

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

Thanks! Can you wrap the whole thing in a check to make sure we actually have at least one gas can ID?

@rftrdev rftrdev merged commit e9b1290 into 1dot13:master Aug 16, 2025
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