Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
starfi5h committed Jun 20, 2024
1 parent 22fade2 commit f930db6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
3 changes: 2 additions & 1 deletion NebulaNetwork/Ngrok/NgrokManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ public bool IsNgrokActive()
_ngrokProcess?.Refresh();
return !_ngrokProcess?.HasExited ?? false;
}
catch
catch (Exception e)
{
Log.Error(e);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit f930db6

Please sign in to comment.