mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Fix for shared memory loot: both the inconsistent tables and the not loading of tables with no items
This commit is contained in:
parent
9c1159837a
commit
26f965e251
@ -1790,7 +1790,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
|||||||
EQEmu::FixedMemoryVariableHashSet<LootTable_Struct> hash(reinterpret_cast<uint8*>(data), size);
|
EQEmu::FixedMemoryVariableHashSet<LootTable_Struct> hash(reinterpret_cast<uint8*>(data), size);
|
||||||
const char *query = "SELECT loottable.id, loottable.mincash, loottable.maxcash, loottable.avgcoin,"
|
const char *query = "SELECT loottable.id, loottable.mincash, loottable.maxcash, loottable.avgcoin,"
|
||||||
" loottable_entries.lootdrop_id, loottable_entries.multiplier, loottable_entries.droplimit, "
|
" loottable_entries.lootdrop_id, loottable_entries.multiplier, loottable_entries.droplimit, "
|
||||||
"loottable_entries.mindrop, loottable_entries.probability FROM loottable JOIN loottable_entries"
|
"loottable_entries.mindrop, loottable_entries.probability FROM loottable LEFT JOIN loottable_entries"
|
||||||
" ON loottable.id = loottable_entries.loottable_id ORDER BY id";
|
" ON loottable.id = loottable_entries.loottable_id ORDER BY id";
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||||
MYSQL_RES *result;
|
MYSQL_RES *result;
|
||||||
@ -1821,6 +1821,10 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!row[4]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
lt->Entries[current_entry].lootdrop_id = static_cast<uint32>(atoul(row[4]));
|
lt->Entries[current_entry].lootdrop_id = static_cast<uint32>(atoul(row[4]));
|
||||||
lt->Entries[current_entry].multiplier = static_cast<uint8>(atoi(row[5]));
|
lt->Entries[current_entry].multiplier = static_cast<uint8>(atoi(row[5]));
|
||||||
lt->Entries[current_entry].droplimit = static_cast<uint8>(atoi(row[6]));
|
lt->Entries[current_entry].droplimit = static_cast<uint8>(atoi(row[6]));
|
||||||
@ -1924,7 +1928,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(loot_drop_hash->exists(loottable_id)) {
|
if(loot_table_hash->exists(loottable_id)) {
|
||||||
return &loot_table_hash->at(loottable_id);
|
return &loot_table_hash->at(loottable_id);
|
||||||
}
|
}
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user