Skip to content

[TF2] Fix crash when opening the loadout with random class selected - #2072

Open
SanyaKor wants to merge 1 commit into
ValveSoftware:masterfrom
SanyaKor:fix/random-class-inventory-crash
Open

SanyaKor wants to merge 1 commit into
ValveSoftware:masterfrom
SanyaKor:fix/random-class-inventory-crash

Conversation

@SanyaKor

Copy link
Copy Markdown

Summary

Fixes a client crash that could occur when selecting the Random class and opening the loadout at the same time.

Cause

TF_CLASS_RANDOM was used as an index into g_VisibleLoadoutSlotsPerClass, even though Random is not a valid player class and has no loadout.

Changes

  • Validate m_iCurrentClassIndex before accessing g_VisibleLoadoutSlotsPerClass.
  • Ignore the openloadout command when no valid player class is selected.

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.

1 participant