1
0
mirror of https://github.com/oliverbooth/VpSharp synced 2024-11-09 23:35:41 +00:00

fix: fix bug where teleported avatars would lose their world reference

This commit is contained in:
Oliver Booth 2024-02-16 16:49:06 +00:00
parent f6991eb697
commit 850b32c389
Signed by: oliverbooth
GPG Key ID: E60B570D1B7557B5

View File

@ -443,7 +443,9 @@ public sealed class VirtualParadiseAvatar : IEquatable<VirtualParadiseAvatar>
}
}
Location = new Location(new VirtualParadiseWorld(_client, world), position, rotation);
VirtualParadiseWorld? updatedWorld = isNewWorld ? await _client.GetWorldAsync(world) : Location.World;
updatedWorld ??= new VirtualParadiseWorld(_client, world);
Location = new Location(updatedWorld, position, rotation);
// ReSharper restore InconsistentlySynchronizedField
}