hedgewars/hwengine.pas
changeset 2786 85f6425a4d74
parent 2747 7889a3a9724f
child 2790 83630d5f94db
--- a/hedgewars/hwengine.pas	Tue Feb 09 21:51:52 2010 +0000
+++ b/hedgewars/hwengine.pas	Wed Feb 10 00:55:40 2010 +0000
@@ -54,11 +54,12 @@
 	uStats in 'uStats.pas',
 	uChat in 'uChat.pas',
 	uTriggers in 'uTriggers.pas',
-	uLandTexture in 'uLandTexture.pas'
+	uLandTexture in 'uLandTexture.pas',
+	uScript in 'uScript.pas',
 	{$IFDEF IPHONEOS}
-	, PascalExports in 'PascalExports.pas'
+	PascalExports in 'PascalExports.pas',
 	{$ELSE}
-	, sysutils
+	sysutils
 	{$ENDIF}
 	;
 
@@ -115,6 +116,7 @@
 				FinishProgress;
 				PlayMusic;
 				SetScale(zoom);
+				ScriptCall('onGameStart');
 				GameState:= gsGame;
 				end;
 		gsConfirm,
@@ -286,11 +288,15 @@
 	    LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName);
         end;
 
+	ScriptCall('onTeamSetup');
+		
 	if recordFileName = '' then
 		SendIPCAndWaitReply('C')        // ask for game config
 	else
 		LoadRecordFromFile(recordFileName);
 
+	ScriptOnGameInit;
+
 	s:= 'eproto ' + inttostr(cNetProtoVersion);
 	SendIPCRaw(@s[0], Length(s) + 1); // send proto version
 
@@ -342,6 +348,7 @@
 	init_uTriggers();
 	init_uVisualGears();
 	init_uWorld();
+	init_uScript();
 end;
 
 procedure freeEverything;
@@ -377,7 +384,7 @@
 	free_uConsole();
 	free_uMisc();
 	free_uConsts();		//stub
-
+	free_uScript();
 end;
 {$IFNDEF IPHONEOS}
 /////////////////////////