Hey guys,
Messing around with a couple of the Patchables and have setup structs for them.
Everything's going great, except for one minor issue that winds up making the code look a little messy.
Namely, some issues with Styx.WoWInternals.WoWDb.Row.
NOTE: To simplify things, I'm going to omit the "Styx.WoWInternals" off of the front of a number of these things, assumes a "using Styx.WoWInternals;" statement.
I've worked out all of the value types in one of the Patchables to the following struct (with variable names removed):
Using this statement (Ignore the typename for the struct, it's not the real name obviously
):
works perfectly, EXCEPT for the string variable. The string comes out either blank or garbled. HOWEVER, the following statement (which should essentially act exactly the same way):
works perfectly and grabs the string, no problem.
So, I assume the issue in the struct is related to string being a reference type by default, but I'm a C++ programmer, not a "pro" C# coder (though I do know my way around C# pretty well), so I figured it was possible I missed something simple on my end.
Does anyone know if there's anything I can do to fix this myself, and if it's an issue in the GetStruct<> code for WoWDb.Row, is there any chance one of the HB devs could fix it?
Any help is greatly appreciated, thanks.
Messing around with a couple of the Patchables and have setup structs for them.
Everything's going great, except for one minor issue that winds up making the code look a little messy.
Namely, some issues with Styx.WoWInternals.WoWDb.Row.
NOTE: To simplify things, I'm going to omit the "Styx.WoWInternals" off of the front of a number of these things, assumes a "using Styx.WoWInternals;" statement.
I've worked out all of the value types in one of the Patchables to the following struct (with variable names removed):
Code:
struct
{
UInt32;
UInt32;
float;
float;
float;
string;
UInt64;
UInt64;
};
Using this statement (Ignore the typename for the struct, it's not the real name obviously

Code:
WoWDb.Row dbRow = dbMain.GetRow(uiIndex);
if (!dbRow.IsValid)
continue;
SStructFromAbove structNode = dbRow.GetStruct<SStructFromAbove>();
works perfectly, EXCEPT for the string variable. The string comes out either blank or garbled. HOWEVER, the following statement (which should essentially act exactly the same way):
Code:
string sSomeString = dbRow.GetField<string>(5);
works perfectly and grabs the string, no problem.
So, I assume the issue in the struct is related to string being a reference type by default, but I'm a C++ programmer, not a "pro" C# coder (though I do know my way around C# pretty well), so I figured it was possible I missed something simple on my end.
Does anyone know if there's anything I can do to fix this myself, and if it's an issue in the GetStruct<> code for WoWDb.Row, is there any chance one of the HB devs could fix it?
Any help is greatly appreciated, thanks.

Last edited: