Skip to content

Commit

Permalink
fix for creature flags (fixes #1286), thanks vulli321
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Sep 10, 2022
1 parent 8557bff commit 910b4de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ARKBreedingStats/CreatureInfoInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ public CreatureFlags CreatureFlags
if (CbMutagen.Checked)
_creatureFlags |= CreatureFlags.MutagenApplied;
else _creatureFlags &= ~CreatureFlags.MutagenApplied;
if (MutationCounterMother > 0 || MutationCounterFather > 0)
_creatureFlags |= CreatureFlags.Mutated;
else _creatureFlags &= ~CreatureFlags.Mutated;

return _creatureFlags;
}
set
Expand Down
7 changes: 7 additions & 0 deletions ARKBreedingStats/Form1.collection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,13 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
// calculate creature values
RecalculateAllCreaturesValues();

foreach (var c in _creatureCollection.creatures)
{
c.InitializeFlags();
if (c.ArkIdImported && c.ArkIdInGame == null)
c.ArkIdInGame = Utils.ConvertImportedArkIdToIngameVisualization(c.ArkId);
}

if (!keepCurrentSelections && _creatureCollection.creatures.Any())
tabControlMain.SelectedTab = tabPageLibrary;

Expand Down
3 changes: 3 additions & 0 deletions ARKBreedingStats/library/DummyCreatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public static List<Creature> CreateCreatures(int count, Species species = null,
if (setServer)
creature.server = $"Server {rand.Next(5) + 1}";

creature.InitializeFlags();

creatures.Add(creature);
}

Expand Down Expand Up @@ -310,6 +312,7 @@ private static List<Creature> BreedCreatures(Creature[] creatures, Species speci
creature.RecalculateNewMutations();

creature.RecalculateAncestorGenerations();
creature.InitializeFlags();

if (noGender)
allCreatures.Add(creature);
Expand Down

0 comments on commit 910b4de

Please sign in to comment.