RynthCore/tools/VendorRateTests/VendorRateTests.csproj
Daniel Wallace 0043be8bba VendorTrade: allow vendors with 0 buy/sell rates
A custom server can run a free storage vendor whose BuyPrice and
SellPrice are both 0: it pays nothing for items handed to it and charges
nothing to take them back. The profile check required rate > 0, so
opening such a vendor logged

  VendorTrade: vendor 0x8007810B profile rates look wrong (buy=0 sell=0);
  trading with it is off.

and every VendorBuy/VendorSell (RynthAi AutoVendor, RynthLua vendor
actions, /rc vendor) was refused with "vendor profile unreadable".

The rate check now accepts finite rates in [0, 1000). Negative, NaN,
infinite and huge values are still treated as a misread profile, and
the warning still fires for them. The check moves to
VendorRatePolicy.cs so tools\VendorRateTests can compile it in.

Rate consumers checked: PlayerPaysForStack, VendorPaysForStack,
EstimateBuy and UnitPrice multiply by the rate and floor at 1 per stack
(the stock ACE rule), so a 0 rate gives a 1-per-stack estimate; there
is no division by a rate anywhere. FillInfo and the /rc vendor info
line only copy or print the rates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:09:32 -07:00

22 lines
888 B
XML

<Project Sdk="Microsoft.NET.Sdk">
<!--
Offline checks for VendorTrade's profile rate check (2026-10-30, a free storage vendor on a
custom server, buy=0 sell=0, had trading turned off): src\RynthCore.Engine\Compatibility\VendorRatePolicy.cs,
compiled in. 0 and ordinary rates pass; negative, NaN, infinite and huge rates fail.
No AC, no files. Run: dotnet run -c Release (exit 0 = pass, 1 = fail)
-->
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<RootNamespace>VendorRateTests</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\src\RynthCore.Engine\Compatibility\VendorRatePolicy.cs" Link="Engine\VendorRatePolicy.cs" />
</ItemGroup>
</Project>