mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-29 04:00:28 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5105dcce04 | ||
|
|
58b4a9a676 | ||
|
|
1146c834fb | ||
|
|
9068264132 | ||
|
|
59ac8ea437 | ||
|
|
afafacaeec | ||
|
|
baf451d2a2 | ||
|
|
d588012168 | ||
|
|
a3ed25cb2e | ||
|
|
c399f45841 |
No files matched your search
+183
-224
@@ -37,6 +37,7 @@ typedef struct {
|
||||
vec3_t *i_vEnd;
|
||||
int i_iNumBullets;
|
||||
qboolean iLarge;
|
||||
float alpha;
|
||||
int iTracerVisible;
|
||||
qboolean bIgnoreEntities;
|
||||
} bullet_tracer_t;
|
||||
@@ -60,21 +61,22 @@ static vec3_t flesh_impact_pos[MAX_IMPACTS];
|
||||
static vec3_t flesh_impact_norm[MAX_IMPACTS];
|
||||
static int flesh_impact_large[MAX_IMPACTS];
|
||||
|
||||
void CG_MakeBulletHoleSound(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, trace_t* pPreTrace) {
|
||||
|
||||
int iSurfType;
|
||||
float fVolume;
|
||||
str sSoundName;
|
||||
vec3_t vFrom, vDest;
|
||||
void CG_MakeBulletHoleSound(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, trace_t *pPreTrace)
|
||||
{
|
||||
int iSurfType;
|
||||
float fVolume;
|
||||
str sSoundName;
|
||||
vec3_t vFrom, vDest;
|
||||
trace_t trace;
|
||||
|
||||
if (pPreTrace) {
|
||||
trace = *pPreTrace;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
VectorMA(i_vPos, 2.0f, i_vNorm, vFrom);
|
||||
VectorMA(i_vPos, -4.0f, i_vNorm, vDest);
|
||||
CG_Trace(&trace, vFrom, vec_zero, vec_zero, vDest, ENTITYNUM_NONE, MASK_SHOT, qfalse, qtrue, "CG_MakeBulletHole");
|
||||
CG_Trace(
|
||||
&trace, vFrom, vec_zero, vec_zero, vDest, ENTITYNUM_NONE, MASK_SHOT, qfalse, qtrue, "CG_MakeBulletHole"
|
||||
);
|
||||
}
|
||||
|
||||
iSurfType = trace.surfaceFlags & MASK_SURF_TYPE;
|
||||
@@ -149,9 +151,12 @@ void CG_MakeBulletHoleSound(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarg
|
||||
commandManager.PlaySound(sSoundName, vFrom, -1, fVolume, -1.f, -1.f, 1);
|
||||
}
|
||||
|
||||
static void CG_MakeBulletHoleType(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, int iEffectNum, float fRadius, qboolean bMakeSound) {
|
||||
static void CG_MakeBulletHoleType(
|
||||
const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, int iEffectNum, float fRadius, qboolean bMakeSound
|
||||
)
|
||||
{
|
||||
if (bMakeSound) {
|
||||
str sBulletHole = "snd_bh_";
|
||||
str sBulletHole = "snd_bh_";
|
||||
float fVolume;
|
||||
|
||||
switch (iEffectNum) {
|
||||
@@ -221,14 +226,15 @@ static void CG_MakeBulletHoleType(const vec3_t i_vPos, const vec3_t i_vNorm, int
|
||||
sfxManager.MakeEffect_Normal(iEffectNum, i_vPos, i_vNorm);
|
||||
}
|
||||
|
||||
static void CG_MakeBulletHole(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, trace_t *pPreTrace, qboolean bMakeSound)
|
||||
static void
|
||||
CG_MakeBulletHole(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, trace_t *pPreTrace, qboolean bMakeSound)
|
||||
{
|
||||
int iSurfType;
|
||||
int iEffect;
|
||||
float fRadius;
|
||||
str sEffectModel;
|
||||
str sBulletHole;
|
||||
vec3_t vFrom, vDest;
|
||||
int iSurfType;
|
||||
int iEffect;
|
||||
float fRadius;
|
||||
str sEffectModel;
|
||||
str sBulletHole;
|
||||
vec3_t vFrom, vDest;
|
||||
trace_t trace;
|
||||
|
||||
if (pPreTrace) {
|
||||
@@ -236,7 +242,9 @@ static void CG_MakeBulletHole(const vec3_t i_vPos, const vec3_t i_vNorm, int iLa
|
||||
} else {
|
||||
VectorMA(i_vPos, 2.0f, i_vNorm, vFrom);
|
||||
VectorMA(i_vPos, -4.0f, i_vNorm, vDest);
|
||||
CG_Trace(&trace, vFrom, vec_zero, vec_zero, vDest, ENTITYNUM_NONE, MASK_SHOT, qfalse, qtrue, "CG_MakeBulletHole");
|
||||
CG_Trace(
|
||||
&trace, vFrom, vec_zero, vec_zero, vDest, ENTITYNUM_NONE, MASK_SHOT, qfalse, qtrue, "CG_MakeBulletHole"
|
||||
);
|
||||
}
|
||||
|
||||
iSurfType = trace.surfaceFlags & MASK_SURF_TYPE;
|
||||
@@ -249,7 +257,7 @@ static void CG_MakeBulletHole(const vec3_t i_vPos, const vec3_t i_vNorm, int iLa
|
||||
}
|
||||
|
||||
VectorAdd(trace.endpos, trace.plane.normal, vFrom);
|
||||
fRadius = 2.0f;
|
||||
fRadius = 2.0f;
|
||||
sBulletHole = "bhole_";
|
||||
|
||||
switch (iSurfType) {
|
||||
@@ -347,36 +355,48 @@ static void CG_MakeBubbleTrail(const vec3_t i_vStart, const vec3_t i_vEnd, int i
|
||||
{
|
||||
vec3_t vDir;
|
||||
vec3_t vPos;
|
||||
float fDist;
|
||||
float fMove;
|
||||
float fDist;
|
||||
float fMove;
|
||||
|
||||
VectorSubtract(i_vEnd, i_vStart, vDir);
|
||||
fDist = VectorNormalize(vDir);
|
||||
VectorCopy(i_vStart, vPos);
|
||||
|
||||
fMove = random() * 8.f;
|
||||
fMove = random() * 8.f * alpha;
|
||||
fDist -= fMove;
|
||||
while (fDist > 0.f) {
|
||||
VectorMA(vPos, fMove, vDir, vPos);
|
||||
sfxManager.MakeEffect_Angles(32, vPos, vec_zero);
|
||||
|
||||
fMove = 16.f + crandom() * 8.f;
|
||||
fMove = 16.f + crandom() * 8.f * alpha;
|
||||
fDist -= fMove;
|
||||
}
|
||||
}
|
||||
|
||||
static void CG_BulletTracerEffect(const vec3_t i_vStart, const vec3_t i_vEnd)
|
||||
static void CG_BulletTracerEffect(const vec3_t i_vStart, const vec3_t i_vEnd, int iLarge, float alpha)
|
||||
{
|
||||
int iLife;
|
||||
int iTracerLength;
|
||||
float fLength, fDist;
|
||||
int iLife;
|
||||
int iTracerLength;
|
||||
float fLength, fDist;
|
||||
vec4_t fTracerColor;
|
||||
vec3_t vDir, vNewStart;
|
||||
float alphaMult;
|
||||
float scale;
|
||||
|
||||
iTracerLength = 450.0f + random() * 150.f;
|
||||
VectorSubtract(i_vEnd, i_vStart, vDir);
|
||||
fLength = VectorNormalize(vDir);
|
||||
|
||||
if (iLarge > 1) {
|
||||
alphaMult = random() * 0.2f + 0.9f;
|
||||
scale = iLarge * 2;
|
||||
} else {
|
||||
alphaMult = 1;
|
||||
scale = 1;
|
||||
}
|
||||
|
||||
fDist = 450.0f + random() * 150.f;
|
||||
|
||||
if (fLength < fDist + 150.f) {
|
||||
float fFrac;
|
||||
|
||||
@@ -384,13 +404,15 @@ static void CG_BulletTracerEffect(const vec3_t i_vStart, const vec3_t i_vEnd)
|
||||
return;
|
||||
}
|
||||
|
||||
fFrac = fLength / (fDist + 150.0);
|
||||
fFrac = fLength / (fDist + 150.0);
|
||||
iTracerLength = (int)((float)iTracerLength * fFrac + 0.5f);
|
||||
fDist *= fFrac;
|
||||
}
|
||||
|
||||
iLife = (int)((fLength - fDist) / 12000.f * 1000.f);
|
||||
if (iLife < 20) iLife = 20;
|
||||
iLife = (int)((fLength - fDist) / 12000.f * 1000.f / (alpha * alphaMult));
|
||||
if (iLife < 20) {
|
||||
iLife = 20;
|
||||
}
|
||||
|
||||
VectorMA(i_vStart, fDist, vDir, vNewStart);
|
||||
fTracerColor[0] = 1.f;
|
||||
@@ -427,53 +449,54 @@ static void CG_BulletTracerEffect(const vec3_t i_vStart, const vec3_t i_vEnd)
|
||||
}
|
||||
|
||||
static void CG_MakeBulletTracerInternal(
|
||||
const vec3_t i_vBarrel,
|
||||
const vec3_t i_vStart,
|
||||
const vec3_t *i_vEnd,
|
||||
int i_iNumBullets,
|
||||
qboolean iLarge,
|
||||
int iTracerVisible,
|
||||
qboolean bIgnoreEntities
|
||||
const vec3_t i_vBarrel,
|
||||
const vec3_t i_vStart,
|
||||
const vec3_t *i_vEnd,
|
||||
int i_iNumBullets,
|
||||
qboolean iLarge,
|
||||
int iTracerVisible,
|
||||
qboolean bIgnoreEntities,
|
||||
float alpha
|
||||
)
|
||||
{
|
||||
vec3_t vPos;
|
||||
int iBullet;
|
||||
int iContinueCount;
|
||||
int iDist;
|
||||
int iHeadDist;
|
||||
int iTravelDist;
|
||||
float fLen, fDist;
|
||||
trace_t trace;
|
||||
qboolean bStartInWater, bInWater;
|
||||
qboolean bBulletDone;
|
||||
qboolean bMadeTracer;
|
||||
vec3_t vDir;
|
||||
vec3_t vTrailStart;
|
||||
vec3_t vTraceStart;
|
||||
vec3_t vTraceEnd;
|
||||
vec3_t vTmp;
|
||||
int iNumImpacts;
|
||||
trace_t tImpacts[128];
|
||||
float fImpSndDistRA;
|
||||
vec3_t vPos;
|
||||
int iBullet;
|
||||
int iContinueCount;
|
||||
int iDist;
|
||||
int iHeadDist;
|
||||
int iTravelDist;
|
||||
float fLen, fDist;
|
||||
trace_t trace;
|
||||
qboolean bStartInWater, bInWater;
|
||||
qboolean bBulletDone;
|
||||
qboolean bMadeTracer;
|
||||
vec3_t vDir;
|
||||
vec3_t vTrailStart;
|
||||
vec3_t vTraceStart;
|
||||
vec3_t vTraceEnd;
|
||||
vec3_t vTmp;
|
||||
int iNumImpacts;
|
||||
trace_t tImpacts[128];
|
||||
float fImpSndDistRA;
|
||||
static float fImpSndDistLA;
|
||||
float fImpSndDistRB;
|
||||
float fImpSndDistLB;
|
||||
int iImpSndIndexRA;
|
||||
int iImpSndIndexRB;
|
||||
int iImpSndIndexLB;
|
||||
float fVolume;
|
||||
float fPitch;
|
||||
float fZingDistA, fZingDistB, fZingDistC;
|
||||
vec3_t vZingPosA, vZingPosB, vZingPosC;
|
||||
float fImpSndDistRB;
|
||||
float fImpSndDistLB;
|
||||
int iImpSndIndexRA;
|
||||
int iImpSndIndexRB;
|
||||
int iImpSndIndexLB;
|
||||
float fVolume;
|
||||
float fPitch;
|
||||
float fZingDistA, fZingDistB, fZingDistC;
|
||||
vec3_t vZingPosA, vZingPosB, vZingPosC;
|
||||
|
||||
fZingDistB = 9999.0;
|
||||
fZingDistA = 9999.0;
|
||||
fZingDistC = 9999.0;
|
||||
fZingDistB = 9999.0;
|
||||
fZingDistA = 9999.0;
|
||||
fZingDistC = 9999.0;
|
||||
iNumImpacts = 0;
|
||||
|
||||
// check to see if it starts in water
|
||||
bStartInWater = (cgi.CM_PointContents(i_vStart, 0) & CONTENTS_FLUID) != 0;
|
||||
|
||||
|
||||
for (iBullet = 0; iBullet < i_iNumBullets; iBullet++) {
|
||||
bInWater = bStartInWater;
|
||||
VectorCopy(i_vBarrel, vTrailStart);
|
||||
@@ -481,8 +504,8 @@ static void CG_MakeBulletTracerInternal(
|
||||
fLen = VectorNormalize(vDir);
|
||||
|
||||
trace.fraction = 0;
|
||||
iDist = (int)fLen + 32;
|
||||
bBulletDone = qfalse;
|
||||
iDist = (int)fLen + 32;
|
||||
bBulletDone = qfalse;
|
||||
iContinueCount = 0;
|
||||
|
||||
if (bStartInWater) {
|
||||
@@ -501,8 +524,7 @@ static void CG_MakeBulletTracerInternal(
|
||||
if (iDist > BULLET_TRAVEL_DIST) {
|
||||
iTravelDist += BULLET_TRAVEL_DIST;
|
||||
iDist -= BULLET_TRAVEL_DIST;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
iTravelDist += iDist;
|
||||
iDist = 0;
|
||||
}
|
||||
@@ -513,16 +535,7 @@ static void CG_MakeBulletTracerInternal(
|
||||
|
||||
while (trace.fraction < 1) {
|
||||
if (bIgnoreEntities) {
|
||||
cgi.CM_BoxTrace(
|
||||
&trace,
|
||||
vTraceStart,
|
||||
vTraceEnd,
|
||||
vec_zero,
|
||||
vec_zero,
|
||||
0,
|
||||
MASK_SHOT,
|
||||
qfalse
|
||||
);
|
||||
cgi.CM_BoxTrace(&trace, vTraceStart, vTraceEnd, vec_zero, vec_zero, 0, MASK_SHOT, qfalse);
|
||||
|
||||
if (trace.fraction == 1.0f) {
|
||||
trace.entityNum = ENTITYNUM_NONE;
|
||||
@@ -533,8 +546,7 @@ static void CG_MakeBulletTracerInternal(
|
||||
if (trace.startsolid) {
|
||||
trace.entityNum = ENTITYNUM_WORLD;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
CG_Trace(
|
||||
&trace,
|
||||
vTraceStart,
|
||||
@@ -556,35 +568,29 @@ static void CG_MakeBulletTracerInternal(
|
||||
VectorNormalizeFast(trace.plane.normal);
|
||||
}
|
||||
|
||||
if (!bInWater && trace.fraction < 1.0f && iNumImpacts <= 127)
|
||||
{
|
||||
if (!bInWater && trace.fraction < 1.0f && iNumImpacts <= 127) {
|
||||
memcpy(&tImpacts[iNumImpacts], &trace, sizeof(trace_t));
|
||||
iNumImpacts++;
|
||||
}
|
||||
|
||||
if (iTracerVisible && !bMadeTracer)
|
||||
{
|
||||
CG_BulletTracerEffect(vTrailStart, trace.endpos);
|
||||
if (iTracerVisible && !bMadeTracer) {
|
||||
CG_BulletTracerEffect(vTrailStart, trace.endpos, iLarge, alpha);
|
||||
bMadeTracer = qtrue;
|
||||
}
|
||||
|
||||
if (trace.fraction < 1.0f) {
|
||||
if (((trace.surfaceFlags & (SURF_HINT | SURF_NODLIGHT | SURF_SNOW | SURF_FOLIAGE | SURF_DIRT)) || (trace.contents & CONTENTS_WATER))
|
||||
&& iContinueCount < 5)
|
||||
{
|
||||
if (bInWater)
|
||||
{
|
||||
if (((trace.surfaceFlags & (SURF_HINT | SURF_NODLIGHT | SURF_SNOW | SURF_FOLIAGE | SURF_DIRT))
|
||||
|| (trace.contents & CONTENTS_WATER))
|
||||
&& iContinueCount < 5) {
|
||||
if (bInWater) {
|
||||
VectorSubtract(trace.endpos, vDir, vTmp);
|
||||
if (!(trace.contents & CONTENTS_FLUID)
|
||||
&& !(trace.surfaceFlags & SURF_PUDDLE)
|
||||
&& !(cgi.CM_PointContents(vTmp, 0) & CONTENTS_FLUID))
|
||||
{
|
||||
CG_MakeBubbleTrail(vTrailStart, trace.endpos, iLarge);
|
||||
if (!(trace.contents & CONTENTS_FLUID) && !(trace.surfaceFlags & SURF_PUDDLE)
|
||||
&& !(cgi.CM_PointContents(vTmp, 0) & CONTENTS_FLUID)) {
|
||||
CG_MakeBubbleTrail(vTrailStart, trace.endpos, iLarge, alpha);
|
||||
VectorCopy(trace.endpos, vTrailStart);
|
||||
bInWater = qfalse;
|
||||
}
|
||||
}
|
||||
else if ((trace.contents & CONTENTS_FLUID) || (trace.surfaceFlags & SURF_PUDDLE)) {
|
||||
} else if ((trace.contents & CONTENTS_FLUID) || (trace.surfaceFlags & SURF_PUDDLE)) {
|
||||
VectorCopy(trace.endpos, vTrailStart);
|
||||
bInWater = qtrue;
|
||||
}
|
||||
@@ -593,11 +599,9 @@ static void CG_MakeBulletTracerInternal(
|
||||
VectorAdd(vTraceStart, vTraceStart, trace.endpos);
|
||||
|
||||
iContinueCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
trace.fraction = 1.0f;
|
||||
bBulletDone = qtrue;
|
||||
bBulletDone = qtrue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -605,14 +609,14 @@ static void CG_MakeBulletTracerInternal(
|
||||
}
|
||||
|
||||
if (bInWater) {
|
||||
CG_MakeBubbleTrail(vTraceStart, trace.endpos, iLarge);
|
||||
CG_MakeBubbleTrail(vTraceStart, trace.endpos, iLarge, alpha);
|
||||
}
|
||||
|
||||
if (iTracerVisible) {
|
||||
iTracerVisible--;
|
||||
}
|
||||
|
||||
fLen = ProjectPointOnLine(i_vStart, i_vEnd[iBullet], cg.SoundOrg, vPos);
|
||||
fLen = ProjectPointOnLine(i_vStart, i_vEnd[iBullet], cg.SoundOrg, vPos);
|
||||
iHeadDist = (int)Distance(vPos, cg.SoundOrg);
|
||||
if (iHeadDist > 255) {
|
||||
continue;
|
||||
@@ -629,7 +633,7 @@ static void CG_MakeBulletTracerInternal(
|
||||
|
||||
if (fLen < 0.f) {
|
||||
VectorCopy(i_vStart, vPos);
|
||||
} else if(fDist >= fLen) {
|
||||
} else if (fDist >= fLen) {
|
||||
VectorCopy(i_vEnd[iBullet], vPos);
|
||||
}
|
||||
|
||||
@@ -652,11 +656,11 @@ static void CG_MakeBulletTracerInternal(
|
||||
}
|
||||
|
||||
if (iNumImpacts > 2) {
|
||||
fImpSndDistRA = 9999.0f;
|
||||
fImpSndDistRB = 9999.0f;
|
||||
fImpSndDistRA = 9999.0f;
|
||||
fImpSndDistRB = 9999.0f;
|
||||
iImpSndIndexRA = 0;
|
||||
iImpSndIndexRB = 0;
|
||||
fImpSndDistLB = 9999.0f;
|
||||
fImpSndDistLB = 9999.0f;
|
||||
iImpSndIndexLB = 0;
|
||||
|
||||
for (iBullet = 0; iBullet < iNumImpacts; iBullet++) {
|
||||
@@ -671,27 +675,23 @@ static void CG_MakeBulletTracerInternal(
|
||||
VectorSubtract(tImpacts[iImpSndIndexLB].endpos, cg.SoundOrg, vTmp);
|
||||
iHeadDist = VectorLength(vTmp);
|
||||
|
||||
if (DotProduct(vTmp, cg.SoundAxis[1]) <= 0.f)
|
||||
{
|
||||
if (DotProduct(vTmp, cg.SoundAxis[1]) <= 0.f) {
|
||||
if (iHeadDist < 9999.0f || iHeadDist < fImpSndDistLB) {
|
||||
if (iHeadDist < 9999.0f) {
|
||||
fImpSndDistRA = iHeadDist;
|
||||
fImpSndDistLB = 9999.0;
|
||||
fImpSndDistRA = iHeadDist;
|
||||
fImpSndDistLB = 9999.0;
|
||||
iImpSndIndexRA = iBullet;
|
||||
} else if (iHeadDist < fImpSndDistLB) {
|
||||
fImpSndDistLB = iHeadDist;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iHeadDist < fImpSndDistRA || iHeadDist < fImpSndDistRB)
|
||||
{
|
||||
} else {
|
||||
if (iHeadDist < fImpSndDistRA || iHeadDist < fImpSndDistRB) {
|
||||
if (iHeadDist < fImpSndDistRA) {
|
||||
iImpSndIndexRB = iImpSndIndexRA;
|
||||
iImpSndIndexRA = iBullet;
|
||||
} else if (iHeadDist < fImpSndDistRB) {
|
||||
fImpSndDistRB = iHeadDist;
|
||||
fImpSndDistRB = iHeadDist;
|
||||
iImpSndIndexRB = iBullet;
|
||||
}
|
||||
}
|
||||
@@ -720,11 +720,7 @@ static void CG_MakeBulletTracerInternal(
|
||||
} else {
|
||||
for (iBullet = 0; iBullet < iNumImpacts; iBullet++) {
|
||||
CG_MakeBulletHole(
|
||||
tImpacts[iBullet].endpos,
|
||||
tImpacts[iBullet].plane.normal,
|
||||
iNumImpacts,
|
||||
&tImpacts[iBullet],
|
||||
qtrue
|
||||
tImpacts[iBullet].endpos, tImpacts[iBullet].plane.normal, iNumImpacts, &tImpacts[iBullet], qtrue
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -732,10 +728,10 @@ static void CG_MakeBulletTracerInternal(
|
||||
if (fZingDistA < 9999.0f) {
|
||||
if (iLarge) {
|
||||
fVolume = 1.0f;
|
||||
fPitch = 0.8f;
|
||||
fPitch = 0.8f;
|
||||
} else {
|
||||
fVolume = 0.8f;
|
||||
fPitch = 1.0f;
|
||||
fPitch = 1.0f;
|
||||
}
|
||||
|
||||
commandManager.PlaySound("snd_b_zing", vZingPosA, -1, fVolume, -1.0f, fPitch, 1);
|
||||
@@ -774,13 +770,14 @@ static void CG_MakeBulletTracer(
|
||||
bullet_tracer->i_vEnd = &bullet_tracer_bullets[bullet_tracers_count];
|
||||
bullet_tracer->i_iNumBullets = i_iNumBullets;
|
||||
|
||||
for (i = 0; i < i_iNumBullets; ++i) {
|
||||
bullet_tracer_bullets[bullet_tracers_count][0] = (*i_vEnd)[i];
|
||||
bullet_tracer_bullets[bullet_tracers_count][1] = (*i_vEnd)[i + 1];
|
||||
bullet_tracer_bullets[bullet_tracers_count++][2] = (*i_vEnd)[i + 2];
|
||||
for (i = 0; i < i_iNumBullets; i++, bullet_tracers_count++) {
|
||||
bullet_tracer_bullets[bullet_tracers_count][0] = i_vEnd[i][0];
|
||||
bullet_tracer_bullets[bullet_tracers_count][1] = i_vEnd[i][1];
|
||||
bullet_tracer_bullets[bullet_tracers_count][2] = i_vEnd[i][2];
|
||||
}
|
||||
|
||||
bullet_tracer->iLarge = iLarge;
|
||||
bullet_tracer->alpha = alpha;
|
||||
bullet_tracer->iTracerVisible = iTracerVisible;
|
||||
bullet_tracer->bIgnoreEntities = bIgnoreEntities;
|
||||
}
|
||||
@@ -797,7 +794,8 @@ void CG_AddBulletTracers()
|
||||
bullet_tracers[i].i_iNumBullets,
|
||||
bullet_tracers[i].iLarge,
|
||||
bullet_tracers[i].iTracerVisible,
|
||||
bullet_tracers[i].bIgnoreEntities
|
||||
bullet_tracers[i].bIgnoreEntities,
|
||||
bullet_tracers[i].alpha
|
||||
);
|
||||
}
|
||||
|
||||
@@ -807,26 +805,24 @@ void CG_AddBulletTracers()
|
||||
|
||||
void CG_AddBulletImpacts()
|
||||
{
|
||||
int i;
|
||||
int iHeadDist;
|
||||
float fVolume;
|
||||
float fImpSndDistRA;
|
||||
int i;
|
||||
int iHeadDist;
|
||||
float fVolume;
|
||||
float fImpSndDistRA;
|
||||
static float fImpSndDistLA = 9999.f;
|
||||
float fImpSndDistRB;
|
||||
float fImpSndDistLB;
|
||||
int iImpSndIndexRA;
|
||||
int iImpSndIndexRB;
|
||||
int iImpSndIndexLB;
|
||||
vec3_t vTmp;
|
||||
str sSoundName;
|
||||
float fImpSndDistRB;
|
||||
float fImpSndDistLB;
|
||||
int iImpSndIndexRA;
|
||||
int iImpSndIndexRB;
|
||||
int iImpSndIndexLB;
|
||||
vec3_t vTmp;
|
||||
str sSoundName;
|
||||
|
||||
if (wall_impact_count)
|
||||
{
|
||||
if (wall_impact_count > 4)
|
||||
{
|
||||
fImpSndDistRA = fImpSndDistLA;
|
||||
fImpSndDistRB = fImpSndDistLA;
|
||||
fImpSndDistLB = fImpSndDistLA;
|
||||
if (wall_impact_count) {
|
||||
if (wall_impact_count > 4) {
|
||||
fImpSndDistRA = fImpSndDistLA;
|
||||
fImpSndDistRB = fImpSndDistLA;
|
||||
fImpSndDistLB = fImpSndDistLA;
|
||||
iImpSndIndexRA = 0;
|
||||
iImpSndIndexRB = 0;
|
||||
iImpSndIndexLB = 0;
|
||||
@@ -834,33 +830,28 @@ void CG_AddBulletImpacts()
|
||||
for (i = 0; i < wall_impact_count; i++) {
|
||||
VectorSubtract(wall_impact_pos[i], cg.SoundOrg, vTmp);
|
||||
iHeadDist = VectorLength(vTmp);
|
||||
|
||||
if (DotProduct(vTmp, cg.SoundAxis[1]) > 0.f)
|
||||
{
|
||||
if (iHeadDist < fImpSndDistRA || iHeadDist < fImpSndDistRB)
|
||||
{
|
||||
|
||||
if (DotProduct(vTmp, cg.SoundAxis[1]) > 0.f) {
|
||||
if (iHeadDist < fImpSndDistRA || iHeadDist < fImpSndDistRB) {
|
||||
if (iHeadDist < fImpSndDistRA) {
|
||||
fImpSndDistRB = fImpSndDistRA;
|
||||
fImpSndDistRA = iHeadDist;
|
||||
fImpSndDistRB = fImpSndDistRA;
|
||||
fImpSndDistRA = iHeadDist;
|
||||
iImpSndIndexRB = iImpSndIndexRA;
|
||||
iImpSndIndexRA = i;
|
||||
} else if (iHeadDist < fImpSndDistRB) {
|
||||
fImpSndDistRB = iHeadDist;
|
||||
fImpSndDistRB = iHeadDist;
|
||||
iImpSndIndexRB = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iHeadDist < fImpSndDistLA || iHeadDist < fImpSndDistLB)
|
||||
{
|
||||
} else {
|
||||
if (iHeadDist < fImpSndDistLA || iHeadDist < fImpSndDistLB) {
|
||||
if (iHeadDist < fImpSndDistLA) {
|
||||
fImpSndDistRA = iHeadDist;
|
||||
fImpSndDistLB = fImpSndDistLA;
|
||||
fImpSndDistRA = iHeadDist;
|
||||
fImpSndDistLB = fImpSndDistLA;
|
||||
iImpSndIndexLB = 0;
|
||||
iImpSndIndexRA = i;
|
||||
} else if (iHeadDist < fImpSndDistLB) {
|
||||
fImpSndDistLB = iHeadDist;
|
||||
fImpSndDistLB = iHeadDist;
|
||||
iImpSndIndexLB = i;
|
||||
}
|
||||
}
|
||||
@@ -908,8 +899,7 @@ void CG_AddBulletImpacts()
|
||||
|
||||
if (wall_impact_type[iImpSndIndexRB] == 2 || wall_impact_type[iImpSndIndexRB] == 3) {
|
||||
sSoundName = "snd_bh_metal";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
sSoundName = "snd_bh_wood";
|
||||
}
|
||||
|
||||
@@ -942,26 +932,15 @@ void CG_AddBulletImpacts()
|
||||
|
||||
if (wall_impact_type[0] == 2 || wall_impact_type[0] == 3) {
|
||||
sSoundName = "snd_bh_metal";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
sSoundName = "snd_bh_wood";
|
||||
}
|
||||
|
||||
commandManager.PlaySound(sSoundName, wall_impact_pos[0], -1, fVolume, -1, -1, 1);
|
||||
|
||||
sfxManager.MakeEffect_Normal(
|
||||
wall_impact_type[0],
|
||||
wall_impact_pos[0],
|
||||
wall_impact_norm[0]
|
||||
);
|
||||
sfxManager.MakeEffect_Normal(wall_impact_type[0], wall_impact_pos[0], wall_impact_norm[0]);
|
||||
} else {
|
||||
CG_MakeBulletHole(
|
||||
wall_impact_pos[0],
|
||||
wall_impact_norm[0],
|
||||
wall_impact_large[0],
|
||||
NULL,
|
||||
qtrue
|
||||
);
|
||||
CG_MakeBulletHole(wall_impact_pos[0], wall_impact_norm[0], wall_impact_large[0], NULL, qtrue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,15 +948,13 @@ void CG_AddBulletImpacts()
|
||||
if (wall_impact_type[iImpSndIndexLB]) {
|
||||
if (wall_impact_large[iImpSndIndexLB]) {
|
||||
fVolume = 1.f;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
fVolume = 0.75f;
|
||||
}
|
||||
|
||||
if (wall_impact_type[iImpSndIndexLB] == 2 || wall_impact_type[iImpSndIndexLB] == 3) {
|
||||
sSoundName = "snd_bh_metal";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
sSoundName = "snd_bh_wood";
|
||||
}
|
||||
|
||||
@@ -998,45 +975,31 @@ void CG_AddBulletImpacts()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
for (i = 0; i < wall_impact_count; i++) {
|
||||
CG_MakeBulletHole(
|
||||
wall_impact_pos[i],
|
||||
wall_impact_norm[i],
|
||||
wall_impact_large[i],
|
||||
NULL,
|
||||
qtrue
|
||||
);
|
||||
CG_MakeBulletHole(wall_impact_pos[i], wall_impact_norm[i], wall_impact_large[i], NULL, qtrue);
|
||||
}
|
||||
}
|
||||
|
||||
wall_impact_count = 0;
|
||||
}
|
||||
|
||||
if (flesh_impact_count)
|
||||
{
|
||||
if (flesh_impact_count > 1)
|
||||
{
|
||||
fImpSndDistRA = 9999.0;
|
||||
if (flesh_impact_count) {
|
||||
if (flesh_impact_count > 1) {
|
||||
fImpSndDistRA = 9999.0;
|
||||
iImpSndIndexRA = 0;
|
||||
|
||||
for (i = 0; i < flesh_impact_count; i++) {
|
||||
VectorSubtract(wall_impact_pos[i], cg.SoundOrg, vTmp);
|
||||
iHeadDist = VectorLength(vTmp);
|
||||
|
||||
if (DotProduct(vTmp, cg.SoundAxis[1]) > 0.f)
|
||||
{
|
||||
if (iHeadDist < fImpSndDistRA)
|
||||
{
|
||||
fImpSndDistRA = iHeadDist;
|
||||
|
||||
if (DotProduct(vTmp, cg.SoundAxis[1]) > 0.f) {
|
||||
if (iHeadDist < fImpSndDistRA) {
|
||||
fImpSndDistRA = iHeadDist;
|
||||
iImpSndIndexRA = i;
|
||||
}
|
||||
}
|
||||
else if (iHeadDist < fImpSndDistLA)
|
||||
{
|
||||
fImpSndDistRA = iHeadDist;
|
||||
} else if (iHeadDist < fImpSndDistLA) {
|
||||
fImpSndDistRA = iHeadDist;
|
||||
iImpSndIndexRA = i;
|
||||
}
|
||||
}
|
||||
@@ -1105,8 +1068,7 @@ void CG_MakeExplosionEffect(const vec3_t vPos, int iType)
|
||||
fRadius = 0;
|
||||
break;
|
||||
case SURF_SNOW:
|
||||
switch (iBaseEffect)
|
||||
{
|
||||
switch (iBaseEffect) {
|
||||
case SFX_EXP_TANK_BASE:
|
||||
iSurfEffect = SFX_EXP_TANK_SNOW;
|
||||
break;
|
||||
@@ -1122,7 +1084,7 @@ void CG_MakeExplosionEffect(const vec3_t vPos, int iType)
|
||||
iBaseEffect = -1;
|
||||
break;
|
||||
}
|
||||
fRadius = 0;
|
||||
fRadius = 0;
|
||||
break;
|
||||
case SURF_CARPET:
|
||||
iSurfEffect = SFX_EXP_GREN_CARPET;
|
||||
@@ -1147,8 +1109,7 @@ void CG_MakeExplosionEffect(const vec3_t vPos, int iType)
|
||||
fRadius = 0;
|
||||
break;
|
||||
case SURF_DIRT:
|
||||
switch (iBaseEffect)
|
||||
{
|
||||
switch (iBaseEffect) {
|
||||
case SFX_EXP_TANK_BASE:
|
||||
iSurfEffect = SFX_EXP_TANK_DIRT;
|
||||
break;
|
||||
@@ -1164,15 +1125,14 @@ void CG_MakeExplosionEffect(const vec3_t vPos, int iType)
|
||||
iBaseEffect = -1;
|
||||
break;
|
||||
}
|
||||
fRadius = 0;
|
||||
fRadius = 0;
|
||||
break;
|
||||
case SURF_GRILL:
|
||||
iSurfEffect = SFX_EXP_GREN_GRILL;
|
||||
fRadius = 0;
|
||||
break;
|
||||
case SURF_GRASS:
|
||||
switch (iBaseEffect)
|
||||
{
|
||||
switch (iBaseEffect) {
|
||||
case SFX_EXP_TANK_BASE:
|
||||
iSurfEffect = SFX_EXP_TANK_DIRT;
|
||||
break;
|
||||
@@ -1190,8 +1150,7 @@ void CG_MakeExplosionEffect(const vec3_t vPos, int iType)
|
||||
fRadius = 0;
|
||||
break;
|
||||
case SURF_ROCK:
|
||||
switch (iBaseEffect)
|
||||
{
|
||||
switch (iBaseEffect) {
|
||||
case SFX_EXP_TANK_BASE:
|
||||
iSurfEffect = SFX_EXP_TANK_STONE;
|
||||
break;
|
||||
|
||||
+91
-166
@@ -27,31 +27,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
#define GAME_VERSION "mohaa-base-1"
|
||||
#define GAME_VERSION "mohaa-base-1"
|
||||
|
||||
#define DEFAULT_GRAVITY 800
|
||||
static const unsigned int MINS_X = -15;
|
||||
static const unsigned int MINS_Y = -15;
|
||||
static const unsigned int MINS_Z = 0; // IneQuation: bounding box and viewheights to match MoHAA
|
||||
static const unsigned int MAXS_X = 15;
|
||||
static const unsigned int MAXS_Y = 15;
|
||||
static const unsigned int MAXS_Z = 96;
|
||||
|
||||
#define SCORE_NOT_PRESENT -9999 // for the CS_SCORES[12] when only one player is present
|
||||
|
||||
#define VOTE_TIME 30000 // 30 seconds before vote times out
|
||||
|
||||
#define MINS_Z 0
|
||||
#define MINS_X -15
|
||||
#define MINS_Y -15
|
||||
#define MAXS_X 15
|
||||
#define MAXS_Y 15
|
||||
|
||||
#define MINS_Z 0 // IneQuation: bounding box and viewheights to match MoHAA
|
||||
#define MAXS_Z 96
|
||||
|
||||
#define DEAD_MINS_Z 32
|
||||
#define CROUCH_MAXS_Z 49
|
||||
#define DEFAULT_VIEWHEIGHT 82
|
||||
#define CROUCH_RUN_VIEWHEIGHT 64
|
||||
#define JUMP_START_VIEWHEIGHT 52
|
||||
#define CROUCH_VIEWHEIGHT 48
|
||||
#define PRONE_VIEWHEIGHT 16
|
||||
#define DEAD_VIEWHEIGHT 8
|
||||
static const unsigned int DEAD_MINS_Z = 32;
|
||||
static const unsigned int CROUCH_MAXS_Z = 49;
|
||||
static const unsigned int DEFAULT_VIEWHEIGHT = 82;
|
||||
static const unsigned int CROUCH_RUN_VIEWHEIGHT = 64;
|
||||
static const unsigned int JUMP_START_VIEWHEIGHT = 52;
|
||||
static const unsigned int CROUCH_VIEWHEIGHT = 48;
|
||||
static const unsigned int PRONE_VIEWHEIGHT = 16;
|
||||
static const unsigned int DEAD_VIEWHEIGHT = 8;
|
||||
|
||||
//
|
||||
// config strings are a general means of communicating variable length strings
|
||||
@@ -139,10 +131,10 @@ extern "C" {
|
||||
GT_MAX_GAME_TYPE
|
||||
} gametype_t;
|
||||
|
||||
//
|
||||
// scale to use when evaluating entityState_t::constantLight scale
|
||||
//
|
||||
#define CONSTANTLIGHT_RADIUS_SCALE 8
|
||||
//
|
||||
// scale to use when evaluating entityState_t::constantLight scale
|
||||
//
|
||||
static const float CONSTANTLIGHT_RADIUS_SCALE = 8;
|
||||
|
||||
typedef enum {
|
||||
GENDER_MALE,
|
||||
@@ -150,30 +142,31 @@ extern "C" {
|
||||
GENDER_NEUTER
|
||||
} gender_t;
|
||||
|
||||
// su44: vma indexes are sent as 4 bits
|
||||
// see playerState_t::iViewModelAnim
|
||||
typedef enum {
|
||||
VMA_IDLE,
|
||||
VMA_CHARGE,
|
||||
VMA_FIRE,
|
||||
VMA_FIRE_SECONDARY,
|
||||
VMA_RECHAMBER,
|
||||
VMA_RELOAD,
|
||||
VMA_RELOAD_SINGLE,
|
||||
VMA_RELOAD_END,
|
||||
VMA_PULLOUT,
|
||||
VMA_PUTAWAY,
|
||||
VMA_LADDERSTEP,
|
||||
VMA_ENABLE,
|
||||
VMA_CUSTOMANIMATION,
|
||||
VMA_NUMANIMATIONS
|
||||
} viewmodelanim_t;
|
||||
enum vmAnim_e {
|
||||
VM_ANIM_DISABLED,
|
||||
VM_ANIM_IDLE,
|
||||
VM_ANIM_CHARGE,
|
||||
VM_ANIM_FIRE,
|
||||
VM_ANIM_FIRE_SECONDARY,
|
||||
VM_ANIM_RECHAMBER,
|
||||
VM_ANIM_RELOAD,
|
||||
VM_ANIM_RELOAD_SINGLE,
|
||||
VM_ANIM_RELOAD_END,
|
||||
VM_ANIM_PULLOUT,
|
||||
VM_ANIM_PUTAWAY,
|
||||
VM_ANIM_LADDERSTEP,
|
||||
VM_ANIM_IDLE_0,
|
||||
VM_ANIM_IDLE_1,
|
||||
VM_ANIM_IDLE_2,
|
||||
};
|
||||
|
||||
// su44: playerState_t::activeItems[8] slots
|
||||
// they are sent as 16 bits
|
||||
// TODO: find out rest of them
|
||||
#define ITEM_AMMO 0 // current ammo
|
||||
#define ITEM_WEAPON 1 // current mainhand weapon
|
||||
// su44: playerState_t::activeItems[8] slots
|
||||
// they are sent as 16 bits
|
||||
// TODO: find out rest of them
|
||||
enum itemtype_e {
|
||||
ITEM_AMMO,
|
||||
ITEM_WEAPON
|
||||
};
|
||||
|
||||
/*
|
||||
===================================================================================
|
||||
@@ -186,17 +179,12 @@ movement on the server game.
|
||||
===================================================================================
|
||||
*/
|
||||
|
||||
#define MAX_CLIP_PLANES 5
|
||||
#define MIN_WALK_NORMAL 0.7f // can't walk on very steep slopes
|
||||
static const unsigned int MAX_CLIP_PLANES = 5;
|
||||
static const float MIN_WALK_NORMAL = 0.7f; // can't walk on very steep slopes
|
||||
|
||||
#define STEPSIZE 18
|
||||
static const float STEPSIZE = 18;
|
||||
|
||||
#define WATER_TURBO_SPEED 1.35f
|
||||
#define WATER_TURBO_TIME 1200
|
||||
#define MINIMUM_RUNNING_TIME 800
|
||||
#define MINIMUM_WATER_FOR_TURBO 90
|
||||
|
||||
#define OVERCLIP 1.001f
|
||||
static const float OVERCLIP = 1.001f;
|
||||
|
||||
// su44: our pmtype_t enum must be the same
|
||||
// as in MoHAA, because playerState_t::pm_type
|
||||
@@ -272,22 +260,25 @@ movement on the server game.
|
||||
#define PMF_UNKNOWN (1 << 14)
|
||||
#define PMF_NO_LEAN (1 << 15)
|
||||
|
||||
// moveposflags
|
||||
#define MPF_POSITION_STANDING (1 << 0)
|
||||
#define MPF_POSITION_CROUCHING (1 << 1)
|
||||
#define MPF_POSITION_PRONE (1 << 2)
|
||||
#define MPF_POSITION_OFFGROUND (1 << 3)
|
||||
// moveposflags
|
||||
enum moveposflags_e {
|
||||
MPF_POSITION_STANDING = (1 << 0),
|
||||
MPF_POSITION_CROUCHING = (1 << 1),
|
||||
MPF_POSITION_PRONE = (1 << 2),
|
||||
MPF_POSITION_OFFGROUND = (1 << 3),
|
||||
MPF_MOVEMENT_WALKING = (1 << 4),
|
||||
MPF_MOVEMENT_RUNNING = (1 << 5),
|
||||
MPF_MOVEMENT_FALLING = (1 << 6),
|
||||
};
|
||||
|
||||
#define MPF_MOVEMENT_WALKING (1 << 4)
|
||||
#define MPF_MOVEMENT_RUNNING (1 << 5)
|
||||
#define MPF_MOVEMENT_FALLING (1 << 6)
|
||||
#define MAXTOUCH 32
|
||||
|
||||
#define MAXTOUCH 32
|
||||
|
||||
#define MOVERESULT_NONE 0 // nothing blocking
|
||||
#define MOVERESULT_TURNED 1 // move blocked, but player turned to avoid it
|
||||
#define MOVERESULT_BLOCKED 2 // move blocked by slope or wall
|
||||
#define MOVERESULT_HITWALL 3 // player ran into wall
|
||||
enum moveresult_e {
|
||||
MOVERESULT_NONE, // nothing blocking
|
||||
MOVERESULT_TURNED, // move blocked, but player turned to avoid it
|
||||
MOVERESULT_BLOCKED, // move blocked by slope or wall
|
||||
MOVERESULT_HITWALL // player ran into wall
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
// state (in / out)
|
||||
@@ -359,36 +350,33 @@ movement on the server game.
|
||||
|
||||
//===================================================================================
|
||||
|
||||
#define MAX_LETTERBOX_SIZE 0x7fff
|
||||
static const unsigned int MAX_LETTERBOX_SIZE = 0x7fff;
|
||||
|
||||
#define ITEM_NAME_AMMO 0
|
||||
#define ITEM_NAME_WEAPON 1
|
||||
|
||||
#define WEAPON_CLASS_PISTOL (1 << 0)
|
||||
#define WEAPON_CLASS_RIFLE (1 << 1)
|
||||
#define WEAPON_CLASS_SMG (1 << 2)
|
||||
#define WEAPON_CLASS_MG (1 << 3)
|
||||
#define WEAPON_CLASS_GRENADE (1 << 4)
|
||||
#define WEAPON_CLASS_HEAVY (1 << 5)
|
||||
#define WEAPON_CLASS_CANNON (1 << 6)
|
||||
#define WEAPON_CLASS_ITEM (1 << 7)
|
||||
#define WEAPON_CLASS_ITEM1 (1 << 8)
|
||||
#define WEAPON_CLASS_ITEM2 (1 << 9)
|
||||
#define WEAPON_CLASS_ITEM3 (1 << 10)
|
||||
#define WEAPON_CLASS_ITEM4 (1 << 11)
|
||||
#define WEAPON_CLASS_ANY_ITEM \
|
||||
(WEAPON_CLASS_ITEM | WEAPON_CLASS_ITEM1 | WEAPON_CLASS_ITEM2 | WEAPON_CLASS_ITEM3 | WEAPON_CLASS_ITEM4)
|
||||
#define WEAPON_CLASS_ITEM_SLOT_BITS (WEAPON_CLASS_ITEM1 | WEAPON_CLASS_ITEM2 | WEAPON_CLASS_ITEM3 | WEAPON_CLASS_ITEM4)
|
||||
|
||||
#define WEAPON_CLASS_PRIMARY (!(WEAPON_CLASS_PISTOL | WEAPON_CLASS_GRENADE))
|
||||
#define WEAPON_CLASS_SECONDARY (WEAPON_CLASS_PISTOL | WEAPON_CLASS_GRENADE)
|
||||
#define WEAPON_CLASS_THROWABLE (WEAPON_CLASS_GRENADE | WEAPON_CLASS_ITEM)
|
||||
#define WEAPON_CLASS_MISC \
|
||||
(WEAPON_CLASS_CANNON | WEAPON_CLASS_ITEM | WEAPON_CLASS_ITEM1 | WEAPON_CLASS_ITEM2 | WEAPON_CLASS_ITEM3 \
|
||||
| WEAPON_CLASS_ITEM4)
|
||||
#define WEAPON_CLASS_ITEMINDEX (WEAPON_CLASS_ITEM1 | WEAPON_CLASS_ITEM2 | WEAPON_CLASS_ITEM3 | WEAPON_CLASS_ITEM4)
|
||||
|
||||
#define STAT_DEAD_YAW 5 // su44: Is there a DEAD_YAW stat in MoHAA?
|
||||
enum weaponclass_e {
|
||||
WEAPON_CLASS_PISTOL = (1 << 0),
|
||||
WEAPON_CLASS_RIFLE = (1 << 1),
|
||||
WEAPON_CLASS_SMG = (1 << 2),
|
||||
WEAPON_CLASS_MG = (1 << 3),
|
||||
WEAPON_CLASS_GRENADE = (1 << 4),
|
||||
WEAPON_CLASS_HEAVY = (1 << 5),
|
||||
WEAPON_CLASS_CANNON = (1 << 6),
|
||||
WEAPON_CLASS_ITEM = (1 << 7),
|
||||
WEAPON_CLASS_ITEM1 = (1 << 8),
|
||||
WEAPON_CLASS_ITEM2 = (1 << 9),
|
||||
WEAPON_CLASS_ITEM3 = (1 << 10),
|
||||
WEAPON_CLASS_ITEM4 = (1 << 11),
|
||||
WEAPON_CLASS_ANY_ITEM =
|
||||
(WEAPON_CLASS_ITEM | WEAPON_CLASS_ITEM1 | WEAPON_CLASS_ITEM2 | WEAPON_CLASS_ITEM3 | WEAPON_CLASS_ITEM4),
|
||||
WEAPON_CLASS_ITEM_SLOT_BITS =
|
||||
(WEAPON_CLASS_ITEM1 | WEAPON_CLASS_ITEM2 | WEAPON_CLASS_ITEM3 | WEAPON_CLASS_ITEM4),
|
||||
WEAPON_CLASS_PRIMARY = (!(WEAPON_CLASS_PISTOL | WEAPON_CLASS_GRENADE)),
|
||||
WEAPON_CLASS_SECONDARY = (WEAPON_CLASS_PISTOL | WEAPON_CLASS_GRENADE),
|
||||
WEAPON_CLASS_THROWABLE = (WEAPON_CLASS_GRENADE | WEAPON_CLASS_ITEM),
|
||||
WEAPON_CLASS_MISC =
|
||||
(WEAPON_CLASS_CANNON | WEAPON_CLASS_ITEM | WEAPON_CLASS_ITEM1 | WEAPON_CLASS_ITEM2 | WEAPON_CLASS_ITEM3
|
||||
| WEAPON_CLASS_ITEM4),
|
||||
WEAPON_CLASS_ITEMINDEX = (WEAPON_CLASS_ITEM1 | WEAPON_CLASS_ITEM2 | WEAPON_CLASS_ITEM3 | WEAPON_CLASS_ITEM4)
|
||||
};
|
||||
|
||||
// player_state->persistant[] indexes
|
||||
// these fields are the only part of player_state that isn't
|
||||
@@ -438,29 +426,8 @@ movement on the server game.
|
||||
#define EF_ANTISBJUICE 0x00200000 // anti sucknblow juice
|
||||
#define EF_DONT_PROCESS_COMMANDS 0x00400000 // don't process client commands for this entity
|
||||
|
||||
// these defines could be deleted sometime when code/game/ is cleared of Q3A stuff
|
||||
#define TEAM_FREE 0
|
||||
#define TEAM_RED 4
|
||||
#define TEAM_BLUE 3
|
||||
#define TEAM_NUM_TEAMS 5
|
||||
|
||||
//===================================================================================
|
||||
|
||||
// flip the togglebit every time an animation
|
||||
// changes so a restart of the same anim can be detected
|
||||
#define ANIM_TOGGLEBIT (1 << 9)
|
||||
#define ANIM_BLEND (1 << 10)
|
||||
#define ANIM_NUMBITS 11
|
||||
|
||||
// server side anim bits
|
||||
#define ANIM_SERVER_EXITCOMMANDS_PROCESSED (1 << 12)
|
||||
|
||||
#define ANIM_MASK (~(ANIM_TOGGLEBIT | ANIM_BLEND | ANIM_SERVER_EXITCOMMANDS_PROCESSED))
|
||||
|
||||
// if FRAME_EXPLICIT is set, don't auto animate
|
||||
#define FRAME_EXPLICIT 512
|
||||
#define FRAME_MASK (~FRAME_EXPLICIT)
|
||||
|
||||
//
|
||||
// Tag specific flags
|
||||
//
|
||||
@@ -601,9 +568,6 @@ movement on the server game.
|
||||
SWT_FUSE_WET
|
||||
} stopWatchType_t;
|
||||
|
||||
// How many players on the overlay
|
||||
#define TEAM_MAXOVERLAY 32
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
||||
// g_dmflags->integer flags
|
||||
@@ -638,7 +602,7 @@ movement on the server game.
|
||||
#define DF_WEAPON_NO_SHOTGUN (1 << 27)
|
||||
#define DF_WEAPON_NO_LANDMINE (1 << 28)
|
||||
|
||||
#define DM_FLAG(flag) (g_gametype->integer && ((int)dmflags->integer & (flag)))
|
||||
#define DM_FLAG(flag) (g_gametype->integer != GT_SINGLE_PLAYER && ((int)dmflags->integer & (flag)))
|
||||
|
||||
// content masks
|
||||
#define MASK_ALL (-1)
|
||||
@@ -736,50 +700,11 @@ movement on the server game.
|
||||
#define MASK_CORNER_NODE \
|
||||
(CONTENTS_SOLID | CONTENTS_LAVA | CONTENTS_SLIME | CONTENTS_UNKNOWN2 | CONTENTS_WEAPONCLIP | CONTENTS_BODY)
|
||||
|
||||
// mohaa mask
|
||||
/*
|
||||
#define MASK_ALL -1
|
||||
#define MASK_SOLID 1
|
||||
|
||||
#define MASK_COLLISION 0x26000B21
|
||||
#define MASK_PERMANENTMARK 0x40000001
|
||||
#define MASK_AUTOCALCLIFE 0x40002021
|
||||
#define MASK_EXPLOSION 0x40040001
|
||||
#define MASK_TREADMARK 0x42012B01
|
||||
#define MASK_THIRDPERSON 0x42012B39
|
||||
#define MASK_FOOTSTEP 0x42022901
|
||||
#define MASK_BEAM 0x42042B01
|
||||
#define MASK_VISIBLE 0x42042B01
|
||||
#define MASK_VEHICLE 0x42042B01
|
||||
#define MASK_BULLET 0x42042B21
|
||||
#define MASK_SHOT 0x42042BA1
|
||||
#define MASK_CROSSHAIRSHADER 0x42092B01
|
||||
#define MASK_TRACER 0x42142B21
|
||||
*/
|
||||
|
||||
void BG_EvaluateTrajectoryDelta(const trajectory_t *tr, int atTime, vec3_t result);
|
||||
|
||||
void BG_PlayerStateToEntityState(playerState_t *ps, entityState_t *s, qboolean snap);
|
||||
void BG_PlayerStateToEntityStateExtraPolate(playerState_t *ps, entityState_t *s, int time, qboolean snap);
|
||||
|
||||
enum vmAnim_e {
|
||||
VM_ANIM_DISABLED,
|
||||
VM_ANIM_IDLE,
|
||||
VM_ANIM_CHARGE,
|
||||
VM_ANIM_FIRE,
|
||||
VM_ANIM_FIRE_SECONDARY,
|
||||
VM_ANIM_RECHAMBER,
|
||||
VM_ANIM_RELOAD,
|
||||
VM_ANIM_RELOAD_SINGLE,
|
||||
VM_ANIM_RELOAD_END,
|
||||
VM_ANIM_PULLOUT,
|
||||
VM_ANIM_PUTAWAY,
|
||||
VM_ANIM_LADDERSTEP,
|
||||
VM_ANIM_IDLE_0,
|
||||
VM_ANIM_IDLE_1,
|
||||
VM_ANIM_IDLE_2,
|
||||
};
|
||||
|
||||
enum cg_message_ver_15_e {
|
||||
CGM_NONE,
|
||||
CGM_BULLET_1,
|
||||
|
||||
@@ -2508,6 +2508,10 @@ void Player::InitPhysics(void)
|
||||
memset(&last_ucmd, 0, sizeof(last_ucmd));
|
||||
|
||||
client->ps.groundTrace.fraction = 1.0f;
|
||||
|
||||
// Added in OPM
|
||||
// Prevent the player from being stuck
|
||||
flags &= ~FL_PARTIAL_IMMOBILE;
|
||||
}
|
||||
|
||||
void Player::InitPowerups(void)
|
||||
@@ -7268,10 +7272,10 @@ void Player::UpdateStats(void)
|
||||
weapon->SetItemSlot(0);
|
||||
} else {
|
||||
client->ps.activeItems[iItem + 2] = weapon->getIndex();
|
||||
weapon->SetItemSlot(256 << iItem);
|
||||
weapon->SetItemSlot(WEAPON_CLASS_ITEM1 << iItem);
|
||||
|
||||
if (activeweap && weapon == activeweap) {
|
||||
client->ps.stats[STAT_EQUIPPED_WEAPON] = 256 << iItem;
|
||||
client->ps.stats[STAT_EQUIPPED_WEAPON] = WEAPON_CLASS_ITEM1 << iItem;
|
||||
}
|
||||
|
||||
iItem++;
|
||||
|
||||
@@ -95,7 +95,7 @@ void Player::WhatIs(Event *ev)
|
||||
|
||||
animname = NULL;
|
||||
if (gi.modeltiki(ent->model)) {
|
||||
animname = gi.Anim_NameForNum(ent->edict->tiki, ent->edict->s.frameInfo[0].index & ANIM_MASK);
|
||||
animname = gi.Anim_NameForNum(ent->edict->tiki, ent->edict->s.frameInfo[0].index);
|
||||
}
|
||||
|
||||
if (!animname) {
|
||||
|
||||
@@ -4373,7 +4373,7 @@ const_str Weapon::GetWeaponGroup(void) const
|
||||
//======================
|
||||
void Weapon::SetItemSlot(int slot)
|
||||
{
|
||||
weapon_class &= WEAPON_CLASS_ITEM_SLOT_BITS;
|
||||
weapon_class &= ~WEAPON_CLASS_ITEM_SLOT_BITS;
|
||||
weapon_class |= slot & WEAPON_CLASS_ITEM_SLOT_BITS;
|
||||
}
|
||||
|
||||
|
||||
@@ -501,8 +501,25 @@ TurretGun::~TurretGun()
|
||||
// Remove the user camera if any.
|
||||
//
|
||||
if (m_pUserCamera) {
|
||||
m_pUserCamera->PostEvent(EV_Remove, 0);
|
||||
m_pUserCamera = NULL;
|
||||
RemoveUserCamera();
|
||||
}
|
||||
|
||||
//
|
||||
// Added in OPM:
|
||||
// Remove the view model.
|
||||
//
|
||||
if (m_pViewModel) {
|
||||
m_pViewModel->Delete();
|
||||
m_pViewModel = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// Added in OPM:
|
||||
// Detach the owner from the turret.
|
||||
//
|
||||
if (owner && owner->IsSubclassOfPlayer()) {
|
||||
Player *player = static_cast<Player *>(owner.Pointer());
|
||||
player->ExitTurret();
|
||||
}
|
||||
|
||||
entflags &= ~EF_TURRET;
|
||||
|
||||
@@ -2496,7 +2496,7 @@ float BulletAttack(
|
||||
|
||||
gi.MSG_WriteBits(count, 6);
|
||||
|
||||
for (int i = count; i > 0; i--) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
gi.MSG_WriteCoord(vEndArray[i][0]);
|
||||
gi.MSG_WriteCoord(vEndArray[i][1]);
|
||||
gi.MSG_WriteCoord(vEndArray[i][2]);
|
||||
|
||||
@@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
// These values are the only one that must be set for the version
|
||||
#define PRODUCT_VERSION_MAJOR 0
|
||||
#define PRODUCT_VERSION_MINOR 60
|
||||
#define PRODUCT_VERSION_PATCH 0
|
||||
#define PRODUCT_VERSION_PATCH 1
|
||||
#define PRODUCT_VERSION_SUFFIX "alpha"
|
||||
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user