Fix exception when entering/leaving workshop

master v2.3
Liza 2023-10-13 00:59:24 +02:00
parent 0bf6e65bfe
commit 2418750b06
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ partial class WorkshopPlugin
if (npcIds.Contains(GetNpcId(obj)))
{
o = obj;
return Vector3.Distance(_clientState.LocalPlayer!.Position, obj.Position + new Vector3(0, -2, 0));
return Vector3.Distance(_clientState.LocalPlayer?.Position ?? Vector3.Zero, obj.Position + new Vector3(0, -2, 0));
}
}
}

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<Version>2.2</Version>
<Version>2.3</Version>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>