mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-07-03 03:14:51 -07:00
Fix error when navigating out of bounds
This commit is contained in:
@@ -81,10 +81,10 @@ namespace SuperStarTrek.Space
|
||||
var newQuadrant = (int)(galacticCoordinate / 8);
|
||||
var newSector = (int)(galacticCoordinate - newQuadrant * 8);
|
||||
|
||||
if (newSector == -1)
|
||||
if (newSector < 0)
|
||||
{
|
||||
newQuadrant -= 1;
|
||||
newSector = 7;
|
||||
newSector += 8;
|
||||
}
|
||||
|
||||
return newQuadrant switch
|
||||
|
||||
Reference in New Issue
Block a user