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

@@ -5,14 +5,14 @@ CDEmoteTableTable::CDEmoteTableTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Emotes");
while (!tableData.eof()) {
CDEmoteTable* entry = new CDEmoteTable();
entry->ID = tableData.getIntField(0, -1);
entry->animationName = tableData.getStringField(1, "");
entry->iconFilename = tableData.getStringField(2, "");
entry->channel = tableData.getIntField(3, -1);
entry->locked = tableData.getIntField(5, -1) != 0;
entry->localize = tableData.getIntField(6, -1) != 0;
entry->locState = tableData.getIntField(7, -1);
entry->gateVersion = tableData.getIntField(8, -1);
entry->ID = tableData.getIntField("id", -1);
entry->animationName = tableData.getStringField("animationName", "");
entry->iconFilename = tableData.getStringField("iconFilename", "");
entry->channel = tableData.getIntField("channel", -1);
entry->locked = tableData.getIntField("locked", -1) != 0;
entry->localize = tableData.getIntField("localize", -1) != 0;
entry->locState = tableData.getIntField("locStatus", -1);
entry->gateVersion = tableData.getStringField("gate_version", "");
entries.insert(std::make_pair(entry->ID, entry));
tableData.nextRow();
@@ -42,3 +42,4 @@ CDEmoteTable* CDEmoteTableTable::GetEmote(int id) {
return nullptr;
}