Fix issues with shared weapon types.

This commit is contained in:
Ottermandias 2024-11-22 14:27:14 +01:00
parent b44a147fdd
commit 525f65e70a
6 changed files with 13 additions and 11 deletions

View file

@ -24,11 +24,12 @@ public sealed class JobChangeState : IService
public ActorIdentifier Identifier
=> State?.Identifier ?? ActorIdentifier.Invalid;
public bool TryGetValue(FullEquipType slot, JobId jobId, out (EquipItem, StateSource) data)
=> _weaponList.TryGet(slot, jobId, out data);
public bool TryGetValue(FullEquipType slot, JobId jobId, bool gameStateAllowed, out (EquipItem, StateSource) data)
=> _weaponList.TryGet(slot, jobId, gameStateAllowed, out data);
public void Set(ActorState state, IEnumerable<(EquipItem, StateSource, JobFlag)> items)
{
Reset();
foreach (var (item, source, flags) in items.Where(p => p.Item1.Valid))
_weaponList.TryAdd(item.Type, item, source, flags);
State = state;

View file

@ -359,7 +359,7 @@ public class StateEditor(
}
var currentType = state.BaseData.Item(weaponSlot).Type;
if (mergedDesign.Weapons.TryGet(currentType, state.LastJob, out var weapon))
if (mergedDesign.Weapons.TryGet(currentType, state.LastJob, true, out var weapon))
{
var source = settings.UseSingleSource ? settings.Source :
weapon.Item2 is StateSource.Game ? StateSource.Game : settings.Source;