private void ActorState_Dead(object sender, EventArgs e) { var actor = _actorManager.Items.Single(x => x.Person.Survival == sender); Map.ReleaseNode(actor.Node, actor); _actorManager.Remove(actor); actor.Person.Survival.Dead -= ActorState_Dead; ProcessMonsterDeath(actor); }
private void ActorState_Dead(object sender, EventArgs e) { var actor = _actorManager.Items.Single(x => x.State == sender); Map.ReleaseNode(actor.Node, actor); _actorManager.Remove(actor); actor.State.Dead -= ActorState_Dead; if (actor.Person is MonsterPerson monsterPerson) { var monsterScheme = monsterPerson.Scheme; var dropSchemes = GetMonsterDropTables(monsterScheme); var loot = new DropTableLoot(actor.Node, dropSchemes, _dropResolver); if (loot.Content.CalcActualItems().Any()) { _propContainerManager.Add(loot); } } }