diff --git a/Projects/Android/AndroidManifest.xml b/Projects/Android/AndroidManifest.xml index e63144e..0679295 100644 --- a/Projects/Android/AndroidManifest.xml +++ b/Projects/Android/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:versionName="1.1.12" android:installLocation="auto" > diff --git a/Projects/Android/jni/OpenJK/code/game/wp_saber.cpp b/Projects/Android/jni/OpenJK/code/game/wp_saber.cpp index 65d219d..3674747 100644 --- a/Projects/Android/jni/OpenJK/code/game/wp_saber.cpp +++ b/Projects/Android/jni/OpenJK/code/game/wp_saber.cpp @@ -6346,6 +6346,75 @@ float WP_SaberRateEnemy( gentity_t *enemy, vec3_t center, vec3_t forward, float return rating; } +gentity_t *WP_SaberFindEnemy( gentity_t *self, gentity_t *saber ) +{ +//FIXME: should be a more intelligent way of doing this, like auto aim? +//closest, most in front... did damage to... took damage from? How do we know who the player is focusing on? + gentity_t *ent, *bestEnt = NULL; + gentity_t *entityList[MAX_GENTITIES]; + int numListedEntities; + vec3_t center, mins, maxs, fwdangles, forward; + int i, e; + float radius = 400; + float rating, bestRating = 0.0f; + + //FIXME: no need to do this in 1st person? + fwdangles[1] = self->client->ps.viewangles[1]; + AngleVectors( fwdangles, forward, NULL, NULL ); + + VectorCopy( saber->currentOrigin, center ); + + for ( i = 0 ; i < 3 ; i++ ) + { + mins[i] = center[i] - radius; + maxs[i] = center[i] + radius; + } + + if ( WP_SaberValidateEnemy( self, self->enemy ) ) + { + bestEnt = self->enemy; + bestRating = WP_SaberRateEnemy( bestEnt, center, forward, radius ); + } + + numListedEntities = gi.EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); + + if ( !numListedEntities ) + {//should we clear the enemy? + return bestEnt; + } + + for ( e = 0 ; e < numListedEntities ; e++ ) + { + ent = entityList[ e ]; + + if ( ent == self || ent == saber || ent == bestEnt ) + { + continue; + } + if ( !WP_SaberValidateEnemy( self, ent ) ) + {//doesn't meet criteria of valid look enemy (don't check current since we would have done that before this func's call + continue; + } + if ( !gi.inPVS( self->currentOrigin, ent->currentOrigin ) ) + {//not even potentially visible + continue; + } + if ( !G_ClearLOS( self, self->client->renderInfo.eyePoint, ent ) ) + {//can't see him + continue; + } + //rate him based on how close & how in front he is + rating = WP_SaberRateEnemy( ent, center, forward, radius ); + if ( rating > bestRating ) + { + bestEnt = ent; + bestRating = rating; + } + } + return bestEnt; +} + +/* gentity_t *WP_SaberFindEnemy( gentity_t *self, gentity_t *saber ) { //FIXME: should be a more intelligent way of doing this, like auto aim? @@ -6437,6 +6506,7 @@ gentity_t *WP_SaberFindEnemy( gentity_t *self, gentity_t *saber ) } return bestEnt; } +*/ void WP_RunSaber( gentity_t *self, gentity_t *saber ) { diff --git a/Projects/Android/jni/OpenJK/code/qcommon/stv_version.h b/Projects/Android/jni/OpenJK/code/qcommon/stv_version.h index 60158f2..333e89a 100644 --- a/Projects/Android/jni/OpenJK/code/qcommon/stv_version.h +++ b/Projects/Android/jni/OpenJK/code/qcommon/stv_version.h @@ -23,7 +23,7 @@ along with this program; if not, see . // Current version of the single player game #include "../win32/AutoVersion.h" -#define JKXR_VERSION "1.1.10-ea" +#define JKXR_VERSION "1.1.12-ea" #ifdef _DEBUG #define Q3_VERSION "(debug)OpenJK: v" VERSION_STRING_DOTTED " JKXR: " JKXR_VERSION