Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Site/code/anacreon.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $Anacreon.debugPrices = function ()
var i;
var traderSovereign;

for (i = 0; i < $Anacreon.sovereignList.length; i++)
for (i in $Anacreon.sovereignList)
{
var sovereign = $Anacreon.sovereignList[i];
if (sovereign != null
Expand Down Expand Up @@ -563,7 +563,7 @@ $Anacreon.processUpdate = function (updateList)
// Clear all caches (we need to do this because sovereigns do not get
// updated every cycle).

for (i = 0; i < $Anacreon.sovereignList.length; i++)
for (i in $Anacreon.sovereignList)
if ($Anacreon.sovereignList[i])
$Anacreon.sovereignList[i].clearCaches();

Expand Down Expand Up @@ -780,7 +780,7 @@ $Anacreon.initSession = function (onInitialized)

// Get sovereigns

$Anacreon.sovereignList = [];
$Anacreon.sovereignList = {};
for (i = 0; i < data.sovereigns.length; i++)
{
var sovereign = data.sovereigns[i];
Expand Down
2 changes: 1 addition & 1 deletion Site/code/galacticmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ $GalacticMap.onDraw = function (mapMetrics)
{
var options = { clipToMap:!snapshot };

for (i = 0; i < $Anacreon.sovereignList.length; i++)
for (i in $Anacreon.sovereignList)
{
var sovereign = $Anacreon.sovereignList[i];
if (sovereign)
Expand Down
6 changes: 4 additions & 2 deletions Site/code/trantor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,8 @@ function onAnimate ()
})
});
}

requestAnimationFrame(onAnimate)
}

function onKeypress (e)
Expand Down Expand Up @@ -1522,7 +1524,7 @@ $(document).ready(function () {
{
$Map.invalidate();
$(window).resize(function () { $Map.invalidate(); });
setInterval(onAnimate, 1000 / FRAMES_PER_SECOND);
onAnimate();
return;
}

Expand Down Expand Up @@ -1588,6 +1590,6 @@ $(document).ready(function () {

// Start animation

setInterval(onAnimate, 1000 / FRAMES_PER_SECOND);
onAnimate()
});
});