Skip to content

Commit cddf74d

Browse files
committed
Fixed some weird issues caused by ce_teamscores_text<n> cvars not properly copying their cvar names.
1 parent 30c64a3 commit cddf74d

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

CastingEssentials/Modules/IngameTeamScores.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ IngameTeamScores::IngameTeamScores() :
2828
{
2929
for (int i = 0; i < CUSTOM_TEXT_COUNT; i++)
3030
{
31-
char name[32];
32-
sprintf_s(name, "ce_teamscores_text%i", i + 1);
31+
sprintf_s(ce_teamscores_text_names[i], "ce_teamscores_text%i", i + 1);
3332

3433
// Help string is expected to be static data
3534
sprintf_s(ce_teamscores_text_helpstrings[i], "Text to display in the %%customtext%i%% dialog variable.", i + 1);
3635

37-
ce_teamscores_text[i] = std::make_unique<ConVar>(name, "", FCVAR_NONE, ce_teamscores_text_helpstrings[i]);
36+
ce_teamscores_text[i] = std::make_unique<ConVar>(ce_teamscores_text_names[i], "", FCVAR_NONE, ce_teamscores_text_helpstrings[i]);
3837
}
3938
}
4039

CastingEssentials/Modules/IngameTeamScores.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ class IngameTeamScores final : public Module<IngameTeamScores>
2626
static constexpr int CUSTOM_TEXT_COUNT = 4;
2727

2828
std::unique_ptr<ConVar> ce_teamscores_text[CUSTOM_TEXT_COUNT];
29+
char ce_teamscores_text_names[CUSTOM_TEXT_COUNT][32];
2930
char ce_teamscores_text_helpstrings[CUSTOM_TEXT_COUNT][64];
3031
};

sdk2013

0 commit comments

Comments
 (0)