This commit is contained in:
Ell 2023-07-20 14:34:15 +02:00
parent ee6be0821a
commit c4a68727af
2 changed files with 3 additions and 3 deletions

View file

@ -105,9 +105,9 @@ public class ExampleMod : Mod {
ActionType.Register(new ActionType.TypeSettings("ExampleMod.SitOnGrass", ObjectCategory.Ground, typeof(ExampleGrassSitAction)) {
// we set this action to be executable only on grass tiles, not on other ground
CanExecute = (actionInfo, _) => {
if (!actionInfo.Map.IsInBounds(actionInfo.ActionLocation.ToPoint()))
if (!actionInfo.GoalMap.IsInBounds(actionInfo.ActionLocation.ToPoint()))
return CanExecuteResult.Hidden;
var tile = actionInfo.Map.GetTile(actionInfo.ActionLocation.ToPoint());
var tile = actionInfo.GoalMap.GetTile(actionInfo.ActionLocation.ToPoint());
// hidden means the action won't be displayed in the ring menu, Valid means the player (or AI) is able to enqueue and execute it
return tile.Name.StartsWith("Grass") ? CanExecuteResult.Valid : CanExecuteResult.Hidden;
},

View file

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TinyLifeApi" Version="0.34.0" />
<PackageReference Include="TinyLifeApi" Version="0.35.0" />
<PackageReference Include="ExtremelySimpleLogger" Version="1.3.1" />
<PackageReference Include="Lib.Harmony" Version="2.2.2" />