NSTraceAttack: Check if we're a client before making the assumptions that our owner class has attributes related to bullet patterns
This commit is contained in:
parent
d0a2480aae
commit
b51541a3ae
2 changed files with 18 additions and 15 deletions
|
@ -412,7 +412,7 @@ prop_vehicle_driveable_wheel::Accel(float flMoveTime, float m_flTurn)
|
|||
if (trace_ent.takedamage) {
|
||||
NSSurfacePropEntity foo = (NSSurfacePropEntity)trace_ent;
|
||||
Damage_Apply(foo, vehParent.m_eDriver, iImpactDamage, 0, DMG_VEHICLE);
|
||||
print(sprintf("Delivering %i impact damage\n", iImpactDamage));
|
||||
//print(sprintf("Delivering %i impact damage\n", iImpactDamage));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -762,8 +762,6 @@ prop_vehicle_driveable::ReceiveEntity(float flSendFlags, float flNew)
|
|||
velocity = [0,0,0];
|
||||
RunVehiclePhysics();
|
||||
customphysics = Physics;
|
||||
|
||||
print(sprintf("%v\n", origin));
|
||||
}
|
||||
|
||||
PredictPreFrame();
|
||||
|
@ -795,7 +793,6 @@ prop_vehicle_driveable::EvaluateEntity(void)
|
|||
if (ATTR_CHANGED(flags))
|
||||
SetSendFlags(VEHFL_FLAGS);
|
||||
|
||||
|
||||
SAVE_STATE(origin);
|
||||
SAVE_STATE(angles);
|
||||
SAVE_STATE(modelindex);
|
||||
|
|
|
@ -172,20 +172,26 @@ NSTraceAttack::Fire(void)
|
|||
vecDir += random(-1,1) * m_vecSpread[0] * v_right;
|
||||
vecDir += random(-1,1) * m_vecSpread[1] * v_up;
|
||||
#else
|
||||
player pl = (player) m_eOwner;
|
||||
/* FOR NOW Monsters will not be able to do spread like players if patterns are enabled */
|
||||
if (!(flags & FL_CLIENT)) {
|
||||
vecDir += random(-1,1) * m_vecSpread[0] * v_right;
|
||||
vecDir += random(-1,1) * m_vecSpread[1] * v_up;
|
||||
} else {
|
||||
player pl = (player) m_eOwner;
|
||||
|
||||
/* weapons have already applied their multiplier... so attempt this */
|
||||
int multiplier = pl.cs_shotmultiplier - m_iShots;
|
||||
float frand = (multiplier / 6);
|
||||
/* weapons have already applied their multiplier... so attempt this */
|
||||
int multiplier = pl.cs_shotmultiplier - m_iShots;
|
||||
float frand = (multiplier / 6);
|
||||
|
||||
/* shoddy attempt at spray patterns */
|
||||
if (frand < 1)
|
||||
frand = frand;
|
||||
else if (frand <= 2)
|
||||
frand = 2 - (frand * 1.5);
|
||||
/* shoddy attempt at spray patterns */
|
||||
if (frand < 1)
|
||||
frand = frand;
|
||||
else if (frand <= 2)
|
||||
frand = 2 - (frand * 1.5);
|
||||
|
||||
vecDir += frand * m_vecSpread[0] * v_right;
|
||||
vecDir += (m_vecSpread[1] * v_up) * 2;
|
||||
vecDir += frand * m_vecSpread[0] * v_right;
|
||||
vecDir += (m_vecSpread[1] * v_up) * 2;
|
||||
}
|
||||
#endif
|
||||
_FireSingle(m_vecOrigin, vecDir, m_flDamage, m_flRange);
|
||||
m_iShots--;
|
||||
|
|
Loading…
Reference in a new issue