Skip to content

Commit

Permalink
fix: type checking code was a bit too specific
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyvion committed May 23, 2024
1 parent de4ec5d commit 5bcd186
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Type checking code was a bit too narrow, causing exceptions where they weren't appropriate.

## [0.8.0] - 2024-05-22

### Added

- Added compatibility with Vanilla Plants Expanded - More Plants' custom aquatic and sandy growing zones.
- Added filtering to hysteresis tab
- Added a setting for counting all items on a map instead of only items in storage
- Added filtering to hysteresis tab.
- Added a setting for counting all items on a map instead of only items in storage.

## [0.7.0] - 2024-05-21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public FarmingHysteresisControlWorker Worker

private void ValidatePlantGrowerType(IPlantToGrowSettable plantGrower, string method)
{
if (controlledClass != plantGrower.GetType())
if (!controlledClass.IsAssignableFrom(plantGrower.GetType()))
{
throw new InvalidOperationException($"Called {nameof(FarmingHysteresisControlDef)}.{method} with an IPlantToGrowSettable of the wrong type. Expected {controlledClass.FullName}, got {plantGrower.GetType().FullName}");
}
Expand Down

0 comments on commit 5bcd186

Please sign in to comment.