Skip to content

Commit

Permalink
Changed exit examination to be more concise
Browse files Browse the repository at this point in the history
  • Loading branch information
ben_pollard committed Dec 6, 2024
1 parent 01c5b92 commit be8b65d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NetAF/Assets/Locations/Exit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Exit(Direction direction, bool isLocked = false, Identifier identifier =
/// <returns>The completed Description.</returns>
private IDescription GenerateDescription()
{
return new ConditionalDescription($"The exit {Direction.ToString().ToLower()} is locked.", $"The exit {Direction.ToString().ToLower()} is unlocked.", () => IsLocked);
return new ConditionalDescription($"{Identifier.Name} is locked.", $"{Identifier.Name} is unlocked.", () => IsLocked);
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions NetAF/Interpretation/SceneCommandInterpreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ private static bool TryParseUseOnCommand(string text, Game game, out ICommand co

if (noun.CaseInsensitiveContains(onPadded))
{
itemName = noun.Substring(0, noun.IndexOf(onPadded, StringComparison.CurrentCultureIgnoreCase));
itemName = noun[..noun.IndexOf(onPadded, StringComparison.CurrentCultureIgnoreCase)];
noun = noun.Replace(itemName, string.Empty);
var onIndex = noun.IndexOf(onPadded, StringComparison.CurrentCultureIgnoreCase);
var targetName = noun.Substring(onIndex + onPadded.Length);
var targetName = noun[(onIndex + onPadded.Length)..];

if (targetName.InsensitiveEquals(Me) || targetName.EqualsExaminable(game.Player))
target = game.Player;
Expand Down

0 comments on commit be8b65d

Please sign in to comment.