public void DeleteCreature(Creature cr)
{
lock (huntLock) {
if (this.loot.killCount.ContainsKey(cr)) {
this.loot.killCount.Remove(cr);
}
if (this.loot.creatureLoot.ContainsKey(cr)) {
this.loot.creatureLoot.Remove(cr);
}
using (var transaction = LootDatabaseManager.BeginTransaction()) {
foreach (KeyValuePair<string, List<string>> kvp in this.loot.logMessages) {
foreach (string msg in kvp.Value) {
if (Parser.ParseCreatureFromLootMessage(msg) == cr) {
LootDatabaseManager.DeleteMessage(this, msg, transaction);
}
}
}
transaction.Commit();
}
}
}