Files
smartaction-spt4/SmartAction.csproj
T
funman300 8de369869f Stage 1: walk while healing legs, for SPT 4.0.13
Ground-up reimplementation of yox92/SmartAction targeting SPT 4.0.13 /
EFT 0.16.9.0.40087. Only the walk-while-healing feature is implemented;
see NOTES.md for status and the deferred sprint work.

Design departures from upstream:

- CanWalk is a guarded postfix, not a transpiler. Upstream rewrote the
  method body, which affects every MovementContext in the raid including
  bots, and is hard-incompatible with the three other mods already
  patching MovementContext in a typical load order (SAIN, ORBIT,
  maschine-DualSideDoorBreach). A postfix that only flips false -> true
  for IsYourPlayer is inert for other entities by construction.

- The postfix re-tests ObstacleCollisionFacade_1.CanMove() before
  lifting. Upstream's transpiler dropped that check along with the
  HealingLegs check, silently disabling obstacle blocking.

- Targets resolve by name via AccessTools.PropertyGetter + nameof rather
  than by GClass number, so they survive EFT version bumps.

Verified in-game against 78 loaded plugins: both patches attach, the
guard rejected 985 non-local MovementContext calls with zero leaks, and
_player was never null across ~4000 guard calls.

CanSprintPatch is parked in deferred/ rather than deleted:
MovementContext.CanSprint does not gate sprinting (EnableSprint calls
Physical.Sprint unconditionally), and forcing it true makes EnableSprint
run ForceStopInteractions()/RemoveLeftHandItem() mid-heal. Details and
the 3.11 -> 4.0.13 rename table are in NOTES.md.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 18:50:16 -07:00

42 lines
2.1 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>disable</Nullable>
<AssemblyName>SmartAction</AssemblyName>
<RootNamespace>SmartAction</RootNamespace>
<Version>2.0.0</Version>
<RestoreSources>https://api.nuget.org/v3/index.json</RestoreSources>
<!-- BSG/Unity assemblies are resolved straight out of the game install.
Override on the command line for a different install:
dotnet build -p:SptDir=/path/to/SPT -->
<SptDir Condition="'$(SptDir)' == ''">/mnt/games/SPT</SptDir>
<ManagedDir>$(SptDir)/EscapeFromTarkov_Data/Managed</ManagedDir>
</PropertyGroup>
<ItemGroup>
<!-- Game -->
<Reference Include="Assembly-CSharp" HintPath="$(ManagedDir)/Assembly-CSharp.dll" Private="false" />
<Reference Include="Comfort" HintPath="$(ManagedDir)/Comfort.dll" Private="false" />
<Reference Include="UnityEngine" HintPath="$(ManagedDir)/UnityEngine.dll" Private="false" />
<Reference Include="UnityEngine.CoreModule" HintPath="$(ManagedDir)/UnityEngine.CoreModule.dll" Private="false" />
<!-- BepInEx + Harmony -->
<Reference Include="BepInEx" HintPath="$(SptDir)/BepInEx/core/BepInEx.dll" Private="false" />
<Reference Include="0Harmony" HintPath="$(SptDir)/BepInEx/core/0Harmony.dll" Private="false" />
<!-- SPT -->
<Reference Include="spt-reflection" HintPath="$(SptDir)/BepInEx/plugins/spt/spt-reflection.dll" Private="false" />
</ItemGroup>
<!-- Opt-in deploy: dotnet build -p:DeployToGame=true -->
<Target Name="DeployToGame" AfterTargets="Build" Condition="'$(DeployToGame)' == 'true'">
<PropertyGroup>
<PluginDir>$(SptDir)/BepInEx/plugins/SmartAction</PluginDir>
</PropertyGroup>
<MakeDir Directories="$(PluginDir)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PluginDir)" />
<Message Importance="high" Text="Deployed $(TargetFileName) -> $(PluginDir)" />
</Target>
</Project>