1
0
mirror of https://github.com/oliverbooth/VpSharp synced 2024-11-22 13:48:48 +00:00

Use ternary for vp_query_cell

This works because CA wanted us to capture the return var, which we are just discarding. VP sometimes you are cursed but in a good way
This commit is contained in:
Oliver Booth 2022-11-30 18:57:27 +00:00
parent 9f16e6cc77
commit 189ef770eb
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -33,14 +33,9 @@ public sealed partial class VirtualParadiseClient
lock (Lock)
{
if (revision is not null)
{
vp_query_cell_revision(NativeInstanceHandle, cell.X, cell.Z, revision.Value);
}
else
{
vp_query_cell(NativeInstanceHandle, cell.X, cell.Z);
}
_ = revision is not null
? vp_query_cell_revision(NativeInstanceHandle, cell.X, cell.Z, revision.Value)
: vp_query_cell(NativeInstanceHandle, cell.X, cell.Z);
}
return channel.Reader.ReadAllAsync();
@ -106,7 +101,7 @@ public sealed partial class VirtualParadiseClient
lock (Lock)
{
_ = vp_int_set(NativeInstanceHandle, IntegerAttribute.ReferenceNumber, id);
reason = (ReasonCode) vp_object_get(NativeInstanceHandle, id);
reason = (ReasonCode)vp_object_get(NativeInstanceHandle, id);
if (reason != ReasonCode.Success)
{
goto PreReturn;