- fixed crash on getting location description without a level

Run `bench` CCMD in fullscreen console, i.e. with no level loaded, wait five seconds, open menu

https://forum.zdoom.org/viewtopic.php?t=73109&start=15#p1198234
This commit is contained in:
alexey.lysiuk 2021-08-24 11:15:16 +03:00
parent 03c8fd9956
commit 4bd617187b
1 changed files with 1 additions and 1 deletions

View File

@ -2849,7 +2849,7 @@ FString System_GetLocationDescription()
{
auto& vp = r_viewpoint;
auto Level = vp.ViewLevel;
return FStringf("Map %s: \"%s\",\nx = %1.4f, y = %1.4f, z = %1.4f, angle = %1.4f, pitch = %1.4f\n%llu fps\n\n",
return Level == nullptr ? FString() : FStringf("Map %s: \"%s\",\nx = %1.4f, y = %1.4f, z = %1.4f, angle = %1.4f, pitch = %1.4f\n%llu fps\n\n",
Level->MapName.GetChars(), Level->LevelName.GetChars(), vp.Pos.X, vp.Pos.Y, vp.Pos.Z, vp.Angles.Yaw.Degrees, vp.Angles.Pitch.Degrees, (unsigned long long)LastCount);
}