mirror of
https://github.com/DrBeef/RTCWQuest.git
synced 2025-03-04 08:01:04 +00:00
Change to allow lase sight on scoped weapons when scope is detached
Co-Authored-By: Grant Bagwell <general@grantbagwell.co.uk>
This commit is contained in:
parent
6acbecac92
commit
94fb379a0d
4 changed files with 39 additions and 33 deletions
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.drbeef.rtcwquest"
|
package="com.drbeef.rtcwquest"
|
||||||
android:versionCode="30"
|
android:versionCode="31"
|
||||||
android:versionName="0.25.0" android:installLocation="auto" >
|
android:versionName="0.25.1" android:installLocation="auto" >
|
||||||
|
|
||||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||||
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>
|
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>
|
||||||
|
|
|
@ -3390,45 +3390,51 @@ void CG_AddPlayerFoot( refEntity_t *parent, playerState_t *ps, centity_t *cent )
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG_LaserSight(const playerState_t *ps) {
|
void CG_LaserSight(const playerState_t *ps) {
|
||||||
|
|
||||||
if (trap_Cvar_VariableIntegerValue("vr_lasersight") != 0 &&
|
if (trap_Cvar_VariableIntegerValue("vr_lasersight") != 0 &&
|
||||||
cgVR->backpackitemactive == 0 &&
|
cgVR->backpackitemactive == 0 &&
|
||||||
cg.predictedPlayerState.stats[STAT_HEALTH] > 0 &&
|
cg.predictedPlayerState.stats[STAT_HEALTH] > 0 &&
|
||||||
!cgVR->screen &&
|
!cgVR->screen &&
|
||||||
!cgVR->scopeengaged)
|
!cgVR->scopeengaged)
|
||||||
{
|
{
|
||||||
switch (ps->weapon)
|
qboolean drawLaserSight = qfalse;
|
||||||
{
|
|
||||||
case WP_KNIFE:
|
|
||||||
case WP_DYNAMITE:
|
|
||||||
case WP_GRENADE_LAUNCHER:
|
|
||||||
case WP_GRENADE_PINEAPPLE:
|
|
||||||
case WP_TESLA:
|
|
||||||
case WP_FLAMETHROWER:
|
|
||||||
case WP_FG42:
|
|
||||||
case WP_GARAND:
|
|
||||||
case WP_MAUSER:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
vec3_t origin;
|
|
||||||
vec3_t endForward;
|
|
||||||
vec3_t angles;
|
|
||||||
clientInfo_t ci;
|
|
||||||
CG_CalculateVRWeaponPosition(0, origin, angles);
|
|
||||||
|
|
||||||
vec3_t forward, right, up;
|
switch (ps->weapon) {
|
||||||
AngleVectors(angles, forward, right, up);
|
case WP_KNIFE:
|
||||||
|
case WP_DYNAMITE:
|
||||||
|
case WP_GRENADE_LAUNCHER:
|
||||||
|
case WP_GRENADE_PINEAPPLE:
|
||||||
|
case WP_TESLA:
|
||||||
|
case WP_FLAMETHROWER:
|
||||||
|
case WP_GARAND:
|
||||||
|
break;
|
||||||
|
case WP_FG42:
|
||||||
|
case WP_MAUSER:
|
||||||
|
drawLaserSight = cgVR->scopedetached; // Only user laser sight on scoped weapons if the scope isn't attached
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
drawLaserSight = qtrue;
|
||||||
|
}
|
||||||
|
|
||||||
trace_t trace;
|
if (drawLaserSight) {
|
||||||
VectorMA(origin, 8192, forward, endForward);
|
vec3_t origin;
|
||||||
trap_CM_BoxTrace(&trace, origin, endForward, NULL, NULL, 0, MASK_SOLID);
|
vec3_t endForward;
|
||||||
|
vec3_t angles;
|
||||||
|
clientInfo_t ci;
|
||||||
|
CG_CalculateVRWeaponPosition(0, origin, angles);
|
||||||
|
|
||||||
ci.health = 1;
|
vec3_t forward, right, up;
|
||||||
ci.handicap = 128; // value out of 255 for alpha channel
|
AngleVectors(angles, forward, right, up);
|
||||||
VectorSet(ci.color, 1, 0, 0);
|
|
||||||
CG_RailTrail2(&ci, origin, trace.endpos);
|
trace_t trace;
|
||||||
}
|
VectorMA(origin, 8192, forward, endForward);
|
||||||
}
|
trap_CM_BoxTrace(&trace, origin, endForward, NULL, NULL, 0, MASK_SOLID);
|
||||||
|
|
||||||
|
ci.health = 1;
|
||||||
|
ci.handicap = 96; // value out of 255 for alpha channel
|
||||||
|
VectorSet(ci.color, 1, 0, 0);
|
||||||
|
CG_RailTrail2(&ci, origin, trace.endpos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ If you have questions concerning this license or the applicable additional terms
|
||||||
// q_shared.h -- included first by ALL program modules.
|
// q_shared.h -- included first by ALL program modules.
|
||||||
// A user mod should never modify this file
|
// A user mod should never modify this file
|
||||||
|
|
||||||
#define Q3_VERSION "RTCWQuest 0.25.0 (Wolf 1.41)"
|
#define Q3_VERSION "RTCWQuest 0.25.1 (Wolf 1.41)"
|
||||||
// ver 1.0.0 - release
|
// ver 1.0.0 - release
|
||||||
// ver 1.0.1 - post-release work
|
// ver 1.0.1 - post-release work
|
||||||
// ver 1.1.0 - patch 1 (12/12/01)
|
// ver 1.1.0 - patch 1 (12/12/01)
|
||||||
|
|
BIN
assets/Controller_diagram_alt.jpg
Normal file
BIN
assets/Controller_diagram_alt.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 283 KiB |
Loading…
Reference in a new issue