DEADSOFTWARE

removed trailing spaces all over the source
[d2df-sdl.git] / src / game / g_map.pas
index 9e14586931983da8adc19b0c6e95b0f3134844e5..90cb224e401f03ba139123567a9177b77e6c16c8 100644 (file)
@@ -781,6 +781,8 @@ var
 begin
   Result := False;
   gMapInfo.Map := Res;
+  TriggersTable := nil;
+  FillChar(texture, SizeOf(texture), 0);
 
 // Çàãðóçêà WAD:
   g_ProcessResourceStr(Res, FileName, SectionName, ResName);
@@ -1146,7 +1148,7 @@ begin
     e_WriteLog('  Loading sky: ' + gMapInfo.SkyName, MSG_NOTIFY);
     g_Game_SetLoadingText(_lc[I_LOAD_SKY], 0, False);
     g_ProcessResourceStr(gMapInfo.SkyName, FileName, SectionName, ResName);
-  
+
     if FileName <> '' then
       FileName := GameDir+'/wads/'+FileName
     else
@@ -1230,6 +1232,7 @@ var
   Data: Pointer;
   Len: Integer;
 begin
+  FillChar(Result, SizeOf(Result), 0);
   g_ProcessResourceStr(Res, FileName, SectionName, ResName);
 
   WAD := TWADEditor_1.Create();
@@ -1298,13 +1301,13 @@ begin
       if not WAD.GetResource('', ResList[a], Data, Len) then Continue;
       CopyMemory(@Sign[0], Data, 3);
       FreeMem(Data);
-   
+
       if Sign = MAP_SIGNATURE then
       begin
         SetLength(Result, Length(Result)+1);
         Result[High(Result)] := ResList[a];
       end;
-   
+
       Sign := '';
     end;
 
@@ -1333,7 +1336,7 @@ begin
 
   ResList := WAD.GetResourcesList('');
   WAD.Free();
+
   if ResList <> nil then
     for a := 0 to High(ResList) do if ResList[a] = ResName then
     begin
@@ -1524,7 +1527,7 @@ procedure g_Map_DrawPanels(PanelType: Word);
         if not (drawDoors xor panels[a].Door) then
           panels[a].Draw();
   end;
-          
+
 begin
   case PanelType of
     PANEL_WALL:       DrawPanels(gWalls);
@@ -1655,7 +1658,7 @@ begin
 
       for a := 0 to h do
         if ( (not b1x3) or
-             ((gBlockMon[a].Width + gBlockMon[a].Height) >= 64) ) and 
+             ((gBlockMon[a].Width + gBlockMon[a].Height) >= 64) ) and
            g_Collide(X, Y, Width, Height,
            gBlockMon[a].X, gBlockMon[a].Y,
            gBlockMon[a].Width, gBlockMon[a].Height) then
@@ -1740,7 +1743,7 @@ end;
 procedure g_Map_SwitchTexture(PanelType: Word; ID: DWORD; AnimLoop: Byte = 0);
 var
   tp: TPanel;
-begin            
+begin
   case PanelType of
     PANEL_WALL, PANEL_OPENDOOR, PANEL_CLOSEDOOR:
       tp := gWalls[ID];