diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 9adfa22fdb090e853788b848391d0312a645827a..408191bb3cd2f2876ca68d0a6cfb3dc1bb59fa81 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
wad, map: string;
mapstr: string;
begin
+ s1 := '';
+ s2 := '';
+ s3 := '';
pc := g_Player_GetCount;
e_TextureFontGetSize(gStdFont, cw, ch);
until FindNext(SR) <> 0;
FindClose(SR);
+ if FindFirst(ModelsDir+'*.pk3', faAnyFile, SR) = 0 then
+ repeat
+ if not g_PlayerModel_Load(ModelsDir+SR.Name) then
+ e_WriteLog(Format('Error loading model %s', [SR.Name]), MSG_WARNING);
+ until FindNext(SR) <> 0;
+ FindClose(SR);
+
gGameOn := False;
gPause := False;
gTime := 0;
g_Game_SetLoadingText(_lc[I_LOAD_MUSIC], 0, False);
g_Sound_CreateWADEx('MUSIC_INTERMUS', GameWAD+':MUSIC\INTERMUS', True);
g_Sound_CreateWADEx('MUSIC_MENU', GameWAD+':MUSIC\MENU', True);
- g_Sound_CreateWADEx('MUSIC_ROUNDMUS', GameWAD+':MUSIC\ROUNDMUS');
+ g_Sound_CreateWADEx('MUSIC_ROUNDMUS', GameWAD+':MUSIC\ROUNDMUS', True);
g_Sound_CreateWADEx('MUSIC_STDENDMUS', GameWAD+':MUSIC\ENDMUS', True);
g_Game_SetLoadingText(_lc[I_LOAD_MENUS], 0, False);
if (not g_Game_IsClient) and
(
(
- (e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_SPACE))
+ (e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_KPRETURN) or e_KeyPressed(IK_SPACE))
and (not gJustChatted) and (not gConsoleShow) and (not gChatShow)
and (g_ActiveWindow = nil)
)
g_Texture_DeleteAll();
g_Frames_DeleteAll();
g_Menu_Free();
-
+
if NetInitDone then g_Net_Free;
// Íàäî óäàëèòü êàðòó ïîñëå òåñòà:
ProcessLoading();
e_PollInput();
-
+
if e_KeyPressed(IK_ESCAPE) or e_KeyPressed(IK_SPACE) then
begin
State := 0;
gWADHash := MD5File(MapsDir + NewWAD);
g_Game_LoadWAD(NewWAD);
end else
- // hash recieved in MC_RECV_GameEvent -> NET_EV_MAPSTART
+ // hash recieved in MC_RECV_GameEvent -> NET_EV_MAPSTART
g_Game_ClientWAD(NewWAD, gWADHash);
end else
ResName := Map;
gCoopTotalSecrets := 0;
gLastMap := False;
end;
-
+
g_Game_ExecuteEvent('onmapstart');
end;
procedure g_Game_DeleteTestMap();
var
- WAD: TWADEditor_1;
+ a: Integer;
MapName: Char16;
- MapList: SArray;
- a, time: Integer;
WadName: string;
+{
+ WAD: TWADEditor_1;
+ MapList: SArray;
+ time: Integer;
+}
begin
a := Pos('.wad:\', gMapToDelete);
if a = 0 then
MapName := '';
CopyMemory(@MapName[0], @gMapToDelete[1], Min(16, Length(gMapToDelete)));
+{
// Èìÿ êàðòû íå ñòàíäàðòíîå òåñòîâîå:
if MapName <> TEST_MAP_NAME then
Exit;
WAD.Free();
g_SetFileTime(WadName, time);
end else
- DeleteFile(WadName);
+}
+ if gTempDelete then DeleteFile(WadName);
end;
procedure GameCVars(P: SArray);
else
Options := Options and (not GAME_OPTION_ALLOWEXIT);
end;
-
+
if (LongBool(Options and GAME_OPTION_ALLOWEXIT)) then
g_Console_Add(_lc[I_MSG_ALLOWEXIT_ON])
else
else
Options := Options and (not GAME_OPTION_BOTVSPLAYER);
end;
-
+
if (LongBool(Options and GAME_OPTION_BOTVSPLAYER)) then
g_Console_Add(_lc[I_MSG_BOTSVSPLAYERS_ON])
else
s, pw: String;
chstr: string;
cmd: string;
- pl: pTNetClient;
+ pl: pTNetClient = nil;
plr: TPlayer;
prt: Word;
nm: Boolean;
MapList := nil;
MapIndex := -1;
- if not FileExists(FileName) then Exit;
+ if not FileExists(FileName) then Exit;
AssignFile(ListFile, FileName);
Reset(ListFile);
// Delete test map after play:
s := Find_Param_Value(pars, '--testdelete');
if (s <> '') then
+ begin
gMapToDelete := MapsDir + map;
+ e_WriteLog('"--testdelete" argument doesn''t supported anymore!', MSG_FATALERROR);
+ Halt(1);
+ end;
// Delete temporary WAD after play:
s := Find_Param_Value(pars, '--tempdelete');