Skip to content

Commit

Permalink
Fix issue with loading games due to breed names needing to use the ne…
Browse files Browse the repository at this point in the history
…w non-space format.

Fix 2 other tests with incorrect asserts.
  • Loading branch information
David Fidge committed Mar 31, 2023
1 parent 5a74ea3 commit 04f9a2a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MarsUndiscovered.Tests/Commands/WalkCommandTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void WalkCommand_Player_Into_Monster_On_Wall_Should_Attack()
Assert.AreEqual(CommandResultEnum.Success, attackCommand.CommandResult.Result);

Assert.IsTrue(monster.Health < healthBefore);
Assert.AreEqual("You hit the tesla coil", attackCommand.CommandResult.Messages[0]);
Assert.AreEqual("You hit the tesla turret", attackCommand.CommandResult.Messages[0]);
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ public void Should_Progress_On_Path_Towards_Unexplored_Region()
mapGenerator.OutdoorMapDimensions = new Point(4, 5);

NewGameWithCustomMapNoMonstersNoItemsNoExitsNoStructures(mapGenerator);

// ..#@
// .###
// ....
Expand All @@ -517,7 +517,7 @@ public void Should_Progress_On_Path_Towards_Unexplored_Region()
_gameWorld.CreateWall(1, 1);
_gameWorld.CreateWall(2, 1);
_gameWorld.CreateWall(3, 1);
_gameWorld.CreateWall(0, 2);
_gameWorld.CreateWall(2, 0);
_gameWorld.SpawnMonster(new SpawnMonsterParams().WithBreed("Roach").AtPosition(new Point(2, 4)));

var monster = _gameWorld.Monsters.Values.First();
Expand Down
2 changes: 1 addition & 1 deletion MarsUndiscovered/Components/Monster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public IMemento<MonsterSaveData> GetSaveState()

base.PopulateSaveState(memento.State);

memento.State.BreedName = Breed.Name;
memento.State.BreedName = Breed.NameWithoutSpaces;
memento.State.WanderPath = _wanderPath?.Steps.ToList();
memento.State.UseGoalMapWander = UseGoalMapWander;

Expand Down

0 comments on commit 04f9a2a

Please sign in to comment.