index 4cba5acb10b21bd2487e25d577e7a4611455449a..e496521d4485a3ada649639ff4b7ebec96ae0bcf 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
procedure g_Mons_ProfilersBegin ();
begin
if (profMonsLOS = nil) then profMonsLOS := TProfiler.Create('LOS CALC', g_profile_history_size);
- profMonsLOS.mainBegin(g_profile_los);
- if g_profile_los then
+ if (profMonsLOS <> nil) then profMonsLOS.mainBegin(g_profile_los);
+ if g_profile_los and (profMonsLOS <> nil) then
begin
profMonsLOS.sectionBegin('loscalc');
profMonsLOS.sectionEnd();
procedure g_Mons_ProfilersEnd ();
begin
- if (profMonsLOS <> nil) and (g_profile_los) then profMapCollision.mainEnd();
+ if (profMonsLOS <> nil) and (g_profile_los) then profMonsLOS.mainEnd();
end;
procedure g_Mons_LOS_Start (); inline;
begin
- profMonsLOS.sectionBeginAccum('loscalc');
+ if (profMonsLOS <> nil) then profMonsLOS.sectionBeginAccum('loscalc');
end;
procedure g_Mons_LOS_End (); inline;
begin
- profMonsLOS.sectionEnd();
+ if (profMonsLOS <> nil) then profMonsLOS.sectionEnd();
end;