Skip to content

Commit

Permalink
ConsoleValue improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspj committed Apr 23, 2023
1 parent 7b3d8e7 commit 30d80b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Engine/source/console/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ char* ConsoleValue::convertToBuffer() const

const char* ConsoleValue::getConsoleData() const
{
return Con::getData(type, ct->dataPtr, 0, ct->enumTable);
return Con::getData(ct->consoleType, ct->dataPtr, 0, ct->enumTable);
}

ConsoleDocFragment* ConsoleDocFragment::smFirst;
Expand Down
5 changes: 3 additions & 2 deletions Engine/source/console/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ enum ConsoleValueType

struct ConsoleValueConsoleType
{
S32 consoleType;
void* dataPtr;
EnumTable* enumTable;
};
Expand Down Expand Up @@ -340,8 +341,8 @@ class ConsoleValue
TORQUE_FORCEINLINE void setConsoleData(S32 consoleType, void* dataPtr, const EnumTable* enumTable)
{
cleanupData();
type = ConsoleValueType::cvSTEntry;
ct = new ConsoleValueConsoleType{ dataPtr, const_cast<EnumTable*>(enumTable) };
type = ConsoleValueType::cvConsoleValueType;
ct = new ConsoleValueConsoleType{ consoleType, dataPtr, const_cast<EnumTable*>(enumTable) };
}

TORQUE_FORCEINLINE S32 getType() const
Expand Down

0 comments on commit 30d80b8

Please sign in to comment.