diff --git a/NebulaNetwork/Ngrok/NgrokManager.cs b/NebulaNetwork/Ngrok/NgrokManager.cs index f92837681..fc1b11da8 100644 --- a/NebulaNetwork/Ngrok/NgrokManager.cs +++ b/NebulaNetwork/Ngrok/NgrokManager.cs @@ -298,8 +298,9 @@ public bool IsNgrokActive() _ngrokProcess?.Refresh(); return !_ngrokProcess?.HasExited ?? false; } - catch + catch (Exception e) { + Log.Error(e); return false; } } diff --git a/NebulaNetwork/PacketProcessors/Factory/Foundation/VeinPosUpdateProcessor.cs b/NebulaNetwork/PacketProcessors/Factory/Foundation/VeinPosUpdateProcessor.cs index 2a80a1470..46e36635b 100644 --- a/NebulaNetwork/PacketProcessors/Factory/Foundation/VeinPosUpdateProcessor.cs +++ b/NebulaNetwork/PacketProcessors/Factory/Foundation/VeinPosUpdateProcessor.cs @@ -35,27 +35,28 @@ protected override void ProcessPacket(VeinPosUpdatePacket packet, NebulaConnecti var rot = Maths.SphericalRotation(pos, Random.value * 360f); GameMain.gpuiManager.AlterModel(veinData.modelIndex, veinData.modelId, packet.VeinId, pos, rot, false); var veinProto = LDB.veins.Select((int)veinData.type); - if (veinProto != null) + if (veinProto == null) { - var magnitude = pos.magnitude; - var normalVector = pos / magnitude; - if (veinData.minerId0 > 0) - { - GameMain.gpuiManager.AlterModel(veinProto.MinerBaseModelIndex, veinData.minerBaseModelId, veinData.minerId0, normalVector * (magnitude + 0.1f), false); - GameMain.gpuiManager.AlterModel(veinProto.MinerCircleModelIndex, veinData.minerCircleModelId0, veinData.minerId0, normalVector * (magnitude + 0.4f), false); - } - if (veinData.minerId1 > 0) - { - GameMain.gpuiManager.AlterModel(veinProto.MinerCircleModelIndex, veinData.minerCircleModelId1, veinData.minerId1, normalVector * (magnitude + 0.6f), false); - } - if (veinData.minerId2 > 0) - { - GameMain.gpuiManager.AlterModel(veinProto.MinerCircleModelIndex, veinData.minerCircleModelId2, veinData.minerId2, normalVector * (magnitude + 0.8f), false); - } - if (veinData.minerId3 > 0) - { - GameMain.gpuiManager.AlterModel(veinProto.MinerCircleModelIndex, veinData.minerCircleModelId3, veinData.minerId3, normalVector * (magnitude + 1f), false); - } + return; + } + var magnitude = pos.magnitude; + var normalVector = pos / magnitude; + if (veinData.minerId0 > 0) + { + GameMain.gpuiManager.AlterModel(veinProto.MinerBaseModelIndex, veinData.minerBaseModelId, veinData.minerId0, normalVector * (magnitude + 0.1f), false); + GameMain.gpuiManager.AlterModel(veinProto.MinerCircleModelIndex, veinData.minerCircleModelId0, veinData.minerId0, normalVector * (magnitude + 0.4f), false); + } + if (veinData.minerId1 > 0) + { + GameMain.gpuiManager.AlterModel(veinProto.MinerCircleModelIndex, veinData.minerCircleModelId1, veinData.minerId1, normalVector * (magnitude + 0.6f), false); + } + if (veinData.minerId2 > 0) + { + GameMain.gpuiManager.AlterModel(veinProto.MinerCircleModelIndex, veinData.minerCircleModelId2, veinData.minerId2, normalVector * (magnitude + 0.8f), false); + } + if (veinData.minerId3 > 0) + { + GameMain.gpuiManager.AlterModel(veinProto.MinerCircleModelIndex, veinData.minerCircleModelId3, veinData.minerId3, normalVector * (magnitude + 1f), false); } } }