fix 1h second item cache issue #661

This commit is contained in:
scott-c 2020-07-05 23:11:45 +08:00
parent d63da1beb9
commit 6014bd8364

View File

@ -32,6 +32,7 @@ enum FigureKey {
struct CharacterCacheKey {
state: Option<Discriminant<CharacterState>>, // TODO: Can this be simplified?
active_tool: Option<ToolKind>,
second_tool: Option<ToolKind>,
shoulder: Option<Item>,
chest: Option<Item>,
belt: Option<Item>,
@ -53,6 +54,13 @@ impl CharacterCacheKey {
} else {
None
},
second_tool: if let Some(ItemKind::Tool(tool)) =
loadout.second_item.as_ref().map(|i| &i.item.kind)
{
Some(tool.kind)
} else {
None
},
shoulder: loadout.shoulder.clone(),
chest: loadout.chest.clone(),
belt: loadout.belt.clone(),