Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix savegame loading, broken by mistaken assumption about script
event loading sequence. Closes ticket:4046
  • Loading branch information
perim committed Sep 13, 2013
1 parent 7db9ad7 commit f3dbdab
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
12 changes: 11 additions & 1 deletion data/base/script/rules.js
Expand Up @@ -2,7 +2,7 @@
//
// * Enable unit design and minimap only when an HQ exists

function eventGameInit()
function setupGame()
{
if (tilesetType == "URBAN")
{
Expand All @@ -29,6 +29,16 @@ function eventGameInit()
showInterface();
}

function eventGameLoaded()
{
setupGame();
}

function eventGameInit()
{
setupGame();
}

function eventStartLevel()
{
// Disable by default
Expand Down
23 changes: 15 additions & 8 deletions data/mp/multiplay/skirmish/rules.js
Expand Up @@ -9,7 +9,7 @@
var lastHitTime = 0;
var cheatmode = false;

function eventGameInit()
function setupGame()
{
if (tilesetType == "URBAN")
{
Expand All @@ -23,9 +23,10 @@ function eventGameInit()
replaceTexture("page-9-player-buildings-bases.png", "page-9-player-buildings-bases-rockies.png");
// for some reason rockies will use arizona babas
}

receiveAllEvents(true);

if (tilesetType != "ARIZONA")
{
setSky("texpages/page-25-sky-urban.png", 0.5, 10000.0);
}
setReticuleButton(0, _("Close"), "image_cancel_up.png", "image_cancel_down.png");
setReticuleButton(1, _("Manufacture (F1)"), "image_manufacture_up.png", "image_manufacture_down.png");
setReticuleButton(2, _("Research (F2)"), "image_research_up.png", "image_research_down.png");
Expand All @@ -34,11 +35,17 @@ function eventGameInit()
setReticuleButton(5, _("Intelligence Display (F5)"), "image_intelmap_up.png", "image_intelmap_down.png");
setReticuleButton(6, _("Commanders (F6)"), "image_commanddroid_up.png", "image_commanddroid_down.png");
showInterface();
}

if (tilesetType != "ARIZONA")
{
setSky("texpages/page-25-sky-urban.png", 0.5, 10000.0);
}
function eventGameLoaded()
{
setupGame();
}

function eventGameInit()
{
receiveAllEvents(true);
setupGame();

hackNetOff();
for (var playnum = 0; playnum < maxPlayers; playnum++)
Expand Down

0 comments on commit f3dbdab

Please sign in to comment.