From bf3006da461a5b080d130cfbd6252b9a244950b0 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 12 Dec 2023 22:46:36 +0000 Subject: [PATCH] Fix crash in JKA --- Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp | 2 +- Projects/Android/jni/OpenJK/code/game/g_main.cpp | 2 +- Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp index 6a33e6e..3bdd43c 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp @@ -3488,7 +3488,7 @@ void CG_FireWeapon( centity_t *cent, qboolean alt_fire ) } //Are we the player? - if (cent->gent->client->ps.clientNum == 0) + if (cent->gent->client && cent->gent->client->ps.clientNum == 0) { /* These are specific to external haptics vest/arms/face combinations diff --git a/Projects/Android/jni/OpenJK/code/game/g_main.cpp b/Projects/Android/jni/OpenJK/code/game/g_main.cpp index c5b6dda..e649f7d 100644 --- a/Projects/Android/jni/OpenJK/code/game/g_main.cpp +++ b/Projects/Android/jni/OpenJK/code/game/g_main.cpp @@ -1452,7 +1452,7 @@ static inline qboolean G_RagWantsHumanoidsOnly( CGhoul2Info *ghlInfo ) { char *GLAName; GLAName = gi.G2API_GetGLAName( ghlInfo ); - assert(GLAName); + //assert(GLAName); if ( !Q_stricmp( "models/players/_humanoid/_humanoid", GLAName ) ) {//only _humanoid skeleton is expected to have these diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp index 02a233c..4f8e78f 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp @@ -3293,7 +3293,7 @@ void CG_FireWeapon( centity_t *cent, qboolean alt_fire ) } //Are we the player? - if (cent->gent->client->ps.clientNum == 0) + if (cent->gent->client && cent->gent->client->ps.clientNum == 0) { /* These are specific to external haptics vest/arms/face combinations