Use field names instead of numbers for CDClient tables (#945)

This commit is contained in:
David Markowitz
2023-01-07 01:48:59 -08:00
committed by GitHub
parent a580e3a2f5
commit 8920cd1063
39 changed files with 488 additions and 450 deletions

View File

@@ -21,11 +21,11 @@ CDVendorComponentTable::CDVendorComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM VendorComponent");
while (!tableData.eof()) {
CDVendorComponent entry;
entry.id = tableData.getIntField(0, -1);
entry.buyScalar = tableData.getFloatField(1, -1.0f);
entry.sellScalar = tableData.getFloatField(2, -1.0f);
entry.refreshTimeSeconds = tableData.getFloatField(3, -1.0f);
entry.LootMatrixIndex = tableData.getIntField(4, -1);
entry.id = tableData.getIntField("id", -1);
entry.buyScalar = tableData.getFloatField("buyScalar", -1.0f);
entry.sellScalar = tableData.getFloatField("sellScalar", -1.0f);
entry.refreshTimeSeconds = tableData.getFloatField("refreshTimeSeconds", -1.0f);
entry.LootMatrixIndex = tableData.getIntField("LootMatrixIndex", -1);
this->entries.push_back(entry);
tableData.nextRow();
@@ -56,3 +56,4 @@ std::vector<CDVendorComponent> CDVendorComponentTable::Query(std::function<bool(
std::vector<CDVendorComponent> CDVendorComponentTable::GetEntries(void) const {
return this->entries;
}