diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp index 6c3ac78..c3ff81f 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp @@ -8533,25 +8533,35 @@ Ghoul2 Insert End for ( int saberNum = 0; saberNum < numSabers; saberNum++ ) { - if ((saberNum == 0 && cent->currentState.saberInFlight) || - cent->gent->client->ps.saber[saberNum].name == nullptr) + if (saberNum == 0 && cent->currentState.saberInFlight) { continue; } + char saberModel[256]; + if (cent->gent->client->ps.saber[saberNum].model == nullptr) + { + //Bit of a fiddle, but if we have no saber model for some reason, just use a default one + strcpy(saberModel, "models/weapons2/saber_1/saber_1.glm"); + } + else + { + strcpy(saberModel, cent->gent->client->ps.saber[saberNum].model); + } + refEntity_t hiltEnt; memset( &hiltEnt, 0, sizeof(refEntity_t) ); BG_CalculateVRSaberPosition(saberNum, hiltEnt.origin, hiltEnt.angles); - int saberModelIndex = G_ModelIndex( cent->gent->client->ps.saber[saberNum].model ); + int saberModelIndex = G_ModelIndex( saberModel ); if (saberModelIndex != cg.saberModelIndex[saberNum]) { if (cg.saber_ghoul2[saberNum].size() != 0) { gi.G2API_RemoveGhoul2Model(cg.saber_ghoul2[saberNum], cg.saberG2Num[saberNum]); } - cg.saberG2Num[saberNum] = gi.G2API_InitGhoul2Model( cg.saber_ghoul2[saberNum], cent->gent->client->ps.saber[saberNum].model, saberModelIndex , NULL_HANDLE, NULL_HANDLE, 0, 0 ); + cg.saberG2Num[saberNum] = gi.G2API_InitGhoul2Model( cg.saber_ghoul2[saberNum], saberModel, saberModelIndex , NULL_HANDLE, NULL_HANDLE, 0, 0 ); cg.saberModelIndex[saberNum] = saberModelIndex; } hiltEnt.ghoul2 = &cg.saber_ghoul2[saberNum]; diff --git a/Projects/Android/jni/OpenJK/code/qcommon/q_shared.h b/Projects/Android/jni/OpenJK/code/qcommon/q_shared.h index 4570f09..d56e814 100644 --- a/Projects/Android/jni/OpenJK/code/qcommon/q_shared.h +++ b/Projects/Android/jni/OpenJK/code/qcommon/q_shared.h @@ -1307,6 +1307,7 @@ typedef struct saved_game.read(fullName); saved_game.read(type); saved_game.read(model); + model = NULL; saved_game.read(skin); saved_game.read(soundOn); saved_game.read(soundLoop); @@ -1540,6 +1541,7 @@ public: saved_game.read(fullName); saved_game.read(type); saved_game.read(model); + model = NULL; saved_game.read(skin); saved_game.read(soundOn); saved_game.read(soundLoop);