Fix setString

This commit is contained in:
Diavolo 2021-08-31 16:31:46 +02:00
parent 9ff6747c5a
commit 032667e91c
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
2 changed files with 7 additions and 1 deletions

View File

@ -88,7 +88,7 @@ namespace Components
{
if (this->dvar && this->dvar->type == Game::dvar_type::DVAR_TYPE_STRING)
{
this->dvar->current.string = string;
Game::Dvar_SetCommand(this->dvar->name, string);
}
}
void Dvar::Var::set(const std::string& string)
@ -100,6 +100,7 @@ namespace Components
if (this->dvar && this->dvar->type == Game::dvar_type::DVAR_TYPE_INT)
{
this->dvar->current.integer = integer;
this->dvar->latched.integer = integer;
}
}
void Dvar::Var::set(float value)
@ -107,6 +108,7 @@ namespace Components
if (this->dvar && this->dvar->type == Game::dvar_type::DVAR_TYPE_FLOAT)
{
this->dvar->current.value = value;
this->dvar->latched.value = value;
}
}
void Dvar::Var::set(bool enabled)
@ -114,6 +116,7 @@ namespace Components
if (this->dvar && this->dvar->type == Game::dvar_type::DVAR_TYPE_BOOL)
{
this->dvar->current.enabled = enabled;
this->dvar->latched.enabled = enabled;
}
}

View File

@ -110,6 +110,9 @@ namespace Game
Dvar_InfoString_Big_t Dvar_InfoString_Big = Dvar_InfoString_Big_t(0x4D98A0);
Dvar_SetCommand_t Dvar_SetCommand = Dvar_SetCommand_t(0x4EE430);
Free_String_t Free_String = Free_String_t(0x470E80);
Copy_String_t Copy_String = Copy_String_t(0x4F3C80);
Encode_Init_t Encode_Init = Encode_Init_t(0x462AB0);
Field_Clear_t Field_Clear = Field_Clear_t(0x437EB0);