Mercurial > wow > wowdb-profiler
comparison Main.lua @ 353:6fc3f3e1be54 WoD
Fix for salvage item quantities and timber loot counts always being 1.
author | MMOSimca <MMOSimca@gmail.com> |
---|---|
date | Fri, 10 Oct 2014 10:41:39 -0400 |
parents | 2776c8b1e253 |
children | e13723c37ca4 |
comparison
equal
deleted
inserted
replaced
352:2776c8b1e253 | 353:6fc3f3e1be54 |
---|---|
1390 local container_id = current_loot.identifier -- For faster access, since this is going to be called 9 times in the next 3 lines | 1390 local container_id = current_loot.identifier -- For faster access, since this is going to be called 9 times in the next 3 lines |
1391 -- Verify that we're still assigning data to the right items | 1391 -- Verify that we're still assigning data to the right items |
1392 if container_id and (container_id == BAG_OF_SALVAGE_ITEM_ID or container_id == CRATE_OF_SALVAGE_ITEM_ID or container_id == BIG_CRATE_OF_SALVAGE_ITEM_ID) then | 1392 if container_id and (container_id == BAG_OF_SALVAGE_ITEM_ID or container_id == CRATE_OF_SALVAGE_ITEM_ID or container_id == BIG_CRATE_OF_SALVAGE_ITEM_ID) then |
1393 Debug("CHAT_MSG_LOOT: AF.ITEM %d (%d)", item_id, quantity) | 1393 Debug("CHAT_MSG_LOOT: AF.ITEM %d (%d)", item_id, quantity) |
1394 current_loot.sources[container_id] = current_loot.sources[container_id] or {} | 1394 current_loot.sources[container_id] = current_loot.sources[container_id] or {} |
1395 current_loot.sources[container_id][item_id] = current_loot.sources[container_id][item_id] or 0 + quantity | 1395 current_loot.sources[container_id][item_id] = (current_loot.sources[container_id][item_id] or 0) + quantity |
1396 else -- If not, cancel the timer and wipe the loot table early | 1396 else -- If not, cancel the timer and wipe the loot table early |
1397 Debug("CHAT_MSG_LOOT: We would have assigned the wrong loot to salvage crates!") | 1397 Debug("CHAT_MSG_LOOT: We would have assigned the wrong loot to salvage crates!") |
1398 ClearTimeBasedLootData() | 1398 ClearTimeBasedLootData() |
1399 end | 1399 end |
1400 end, | 1400 end, |
1407 -- Check for top level object data | 1407 -- Check for top level object data |
1408 local object_entry = DBEntry("objects", ("OPENING:%s"):format(private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[last_timber_spell_id])) | 1408 local object_entry = DBEntry("objects", ("OPENING:%s"):format(private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[last_timber_spell_id])) |
1409 local difficulty_token = InstanceDifficultyToken() | 1409 local difficulty_token = InstanceDifficultyToken() |
1410 if object_entry[difficulty_token] then | 1410 if object_entry[difficulty_token] then |
1411 -- Increment loot count | 1411 -- Increment loot count |
1412 object_entry[difficulty_token]["opening_count"] = object_entry[difficulty_token]["opening_count"] or 0 + 1 | 1412 object_entry[difficulty_token]["opening_count"] = (object_entry[difficulty_token]["opening_count"] or 0) + 1 |
1413 | 1413 |
1414 -- Add drop data | 1414 -- Add drop data |
1415 object_entry[difficulty_token]["opening"] = object_entry[difficulty_token]["opening"] or {} | 1415 object_entry[difficulty_token]["opening"] = object_entry[difficulty_token]["opening"] or {} |
1416 table.insert(object_entry[difficulty_token]["opening"], ("%d:%d"):format(item_id, quantity)) | 1416 table.insert(object_entry[difficulty_token]["opening"], ("%d:%d"):format(item_id, quantity)) |
1417 else | 1417 else |