mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-03-02 14:17:13 +00:00
send only the current wheel state, and prevent memory leak bug in Mirror
This commit is contained in:
parent
626567e289
commit
a6713c24da
1 changed files with 1 additions and 0 deletions
|
@ -147,6 +147,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
||||||
m_net_angularVelocity = m_vehicle.RigidBody.angularVelocity;
|
m_net_angularVelocity = m_vehicle.RigidBody.angularVelocity;
|
||||||
|
|
||||||
// wheels
|
// wheels
|
||||||
|
m_net_wheelsData.Flush(); // remove current list of changes - this ensures that only the current wheel state is sent, and prevents memory leak bug in Mirror
|
||||||
m_net_wheelsData.Clear();
|
m_net_wheelsData.Clear();
|
||||||
foreach (var wheel in m_vehicle.Wheels) {
|
foreach (var wheel in m_vehicle.Wheels) {
|
||||||
m_net_wheelsData.Add(new WheelSyncData() {
|
m_net_wheelsData.Add(new WheelSyncData() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue