Whenever I launch my game in the selected viewport, Unreal crashes and presents that error code. However, when I launch the game as a standalone, it works fine.
The full log is:
Access violation - code c0000005 (first/second chance not available)
UE4Editor_UQuake!AUQuakeCharacter::GetCurrentWeaponAmmo() [f:\my documents\repos\uquake\source\uquake\uquakecharacter.cpp:197]
UE4Editor_UQuake!AUQuakeHUD::DrawHUD() [f:\my documents\repos\uquake\source\uquake\uquakehud.cpp:41]
UE4Editor_Engine!AHUD::PostRender() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\engine\private\hud.cpp:158]
UE4Editor_Engine!UGameViewportClient::Draw() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\engine\private\gameviewportclient.cpp:1213]
UE4Editor_Engine!FViewport::Draw() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\engine\private\unrealclient.cpp:1163]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build\++ue4+release-4.14+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:1615]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build\++ue4+release-4.14+compile\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:371]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2859]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\launch\private\launch.cpp:152]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll
However, GetCurrentWeaponAmmo() is a single line statement, which does appear to work. In both cases, the HUD does draw the correct value for the weapon ammo, so I’m not sure why it’s only crashing in the editor window.
EDIT: Ok, it turns out that I accidentally had left Unreal launching 2 players instead of 1. Putting it back to 1 prevented the crash in the editor window. So the question becomes why does it crash on 2 players?