From 2a3efff83e03f4dff0da5ebd03527dc3bbf0e899 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 27 May 2023 00:14:10 +0100 Subject: [PATCH] Fix crash when entering AT-ST in JKA --- Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp index f7cea2e..41d33ec 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp @@ -1318,7 +1318,6 @@ qboolean CG_CalcFOVFromX( float fov_x ) } // set it - cg.refdef.override_fov = inwater; cg.refdef.fov_x = fov_x; cg.refdef.fov_y = fov_y; @@ -2179,7 +2178,14 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) { vr->vehicle_type = VH_NONE; if (vr->in_vehicle) { - vr->vehicle_type = (int)g_entities[g_entities[0].s.m_iVehicleNum].m_pVehicle->m_pVehicleInfo->type; + if (g_entities[0].client->NPC_class == CLASS_ATST) + { + vr->vehicle_type = VH_WALKER; + } + else if (g_entities[0].s.m_iVehicleNum != 0 && g_entities[g_entities[0].s.m_iVehicleNum].m_pVehicle) + { + vr->vehicle_type = (int) g_entities[g_entities[0].s.m_iVehicleNum].m_pVehicle->m_pVehicleInfo->type; + } } vr->remote_npc = !Q_stricmp( "NPC", g_entities[cg.snap->ps.viewEntity].classname );