mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-14 18:48:04 -07:00
Improve CVars a bit (#283)
* Improve CVars a bit * Just use boolean operators on ptr
This commit is contained in:
parent
a12e8b68ae
commit
a5651742ba
4 changed files with 32 additions and 42 deletions
|
@ -336,7 +336,7 @@ static bool SetCVarHandler(const std::vector<std::string>& args) {
|
|||
int vType = CheckVarType(args[2]);
|
||||
|
||||
if (vType == VARTYPE_STRING)
|
||||
CVar_SetString(args[1].c_str(), (char*)args[2].c_str());
|
||||
CVar_SetString(args[1].c_str(), args[2].c_str());
|
||||
else if (vType == VARTYPE_FLOAT)
|
||||
CVar_SetFloat(args[1].c_str(), std::stof(args[2]));
|
||||
else
|
||||
|
@ -353,7 +353,7 @@ static bool GetCVarHandler(const std::vector<std::string>& args) {
|
|||
if (args.size() < 2)
|
||||
return CMD_FAILED;
|
||||
|
||||
CVar* cvar = CVar_GetVar(args[1].c_str());
|
||||
CVar* cvar = CVar_Get(args[1].c_str());
|
||||
|
||||
if (cvar != nullptr)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue