Permalink
Browse files

Fix savegame loading, broken by mistaken assumption about script

event loading sequence. Closes ticket:4046
  • Loading branch information...
1 parent 7db9ad7 commit f3dbdabf034f1c9239e1452ee5976b70a4a7f231 @perim perim committed Sep 13, 2013
Showing with 26 additions and 9 deletions.
  1. +11 −1 data/base/script/rules.js
  2. +15 −8 data/mp/multiplay/skirmish/rules.js
View
12 data/base/script/rules.js
@@ -2,7 +2,7 @@
//
// * Enable unit design and minimap only when an HQ exists
-function eventGameInit()
+function setupGame()
{
if (tilesetType == "URBAN")
{
@@ -29,6 +29,16 @@ function eventGameInit()
showInterface();
}
+function eventGameLoaded()
+{
+ setupGame();
+}
+
+function eventGameInit()
+{
+ setupGame();
+}
+
function eventStartLevel()
{
// Disable by default
View
23 data/mp/multiplay/skirmish/rules.js
@@ -9,7 +9,7 @@
var lastHitTime = 0;
var cheatmode = false;
-function eventGameInit()
+function setupGame()
{
if (tilesetType == "URBAN")
{
@@ -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");
@@ -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++)

0 comments on commit f3dbdab

Please sign in to comment.