Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Yeninas <[email protected]>
  • Loading branch information
starfi5h and PhantomGamers authored Mar 10, 2024
1 parent 44df59a commit 4185b63
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions NebulaWorld/Player/GizmoManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ public void OnUpdate()

private static void GetMapPing()
{
// Modify from UIGlobemap.TeleportLogic
if (Camera.main == null || GameMain.localPlanet == null) return;
// Modify from UIGlobemap.TeleportLogic
var mainCam = Camera.main;
if (mainCam == null || GameMain.localPlanet == null) return;
if (!Physics.Raycast(mainCam.ScreenPointToRay(Input.mousePosition), out var hitInfo, 800f, 8720, QueryTriggerInteraction.Collide)) return;
if (!Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out var hitInfo, 800f, 8720, QueryTriggerInteraction.Collide)) return;

var starmap = UIRoot.instance.uiGame.starmap;
Expand Down Expand Up @@ -128,7 +130,7 @@ private static void GetMapPing()
private void UpdateIndicator()
{
if (GameMain.mainPlayer.gizmo.naviIndicatorGizmo != null
&& naviIndicatorGizmo != null) // When main player is navigating to other target, close the exisitng one
&& naviIndicatorGizmo != null) // When main player is navigating to other target, close the existing one
{
indicatorPlayerId = 0;
indicatorPlanetId = 0;
Expand Down Expand Up @@ -159,7 +161,7 @@ private void UpdateIndicator()
return;
}

// Close gizmos if there is no vaild target
// Close gizmos if there is no valid target
indicatorPlayerId = 0;
indicatorPlanetId = 0;
if (naviIndicatorGizmoStarmap != null)
Expand Down

0 comments on commit 4185b63

Please sign in to comment.