Skip to content

Commit e72d74d

Browse files
committed
Fixed incorrect bullet spread cone flattening.
1 parent a87902f commit e72d74d

9 files changed

Lines changed: 37 additions & 26 deletions

reactivedrop/resource/swarmopedia.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,6 +2430,7 @@
24302430
"StoppingPower" {}
24312431
"BulletSpread" {
24322432
"Base" "3"
2433+
"Flattened" "1"
24332434
}
24342435
"Generic" {
24352436
"Icon" "swarm/swarmopedia/fact/accurate_crouch"

src/game/shared/swarm/asw_weapon_50calmg_shared.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,23 @@ void CASW_Weapon_50CalMG::Precache()
8181

8282
const Vector& CASW_Weapon_50CalMG::GetBulletSpread( void )
8383
{
84-
static const Vector cone( 0.17365, 0.17365, 0.02 ); // VECTOR_CONE_20DEGREES with flattened Z
85-
static const Vector cone_duck = Vector( 0.13053, 0.13053, 0.01 ); // VECTOR_CONE_15DEGREES with flattened Z
84+
static const Vector cone( 0.17365, 0.02, 0.17365 ); // VECTOR_CONE_20DEGREES with flattened Y
85+
static const Vector cone_duck = Vector( 0.13053, 0.01, 0.13053 ); // VECTOR_CONE_15DEGREES with flattened Y
86+
87+
CASW_Marine* marine = GetMarine();
88+
89+
if ( marine )
90+
{
91+
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking )
92+
return cone_duck;
93+
}
94+
return cone;
95+
}
96+
97+
const Vector& CASW_Weapon_50CalMG::GetAngularBulletSpread( void )
98+
{
99+
static const Vector cone( 0, 60, 0 );
100+
static const Vector cone_duck( 5, 40, 5 );
86101

87102
CASW_Marine* marine = GetMarine();
88103

src/game/shared/swarm/asw_weapon_50calmg_shared.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ class CASW_Weapon_50CalMG : public CASW_Weapon_Rifle
2424

2525
virtual void SecondaryAttack();
2626

27-
virtual const Vector& GetAngularBulletSpread()
28-
{
29-
static const Vector cone(60, 60, 10);
30-
return cone;
31-
}
32-
27+
virtual const Vector& GetAngularBulletSpread( void );
3328
virtual const Vector& GetBulletSpread( void );
3429

3530
#ifndef CLIENT_DLL

src/game/shared/swarm/asw_weapon_autogun_shared.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ int CASW_Weapon_Autogun::GetWeaponSubSkillId()
177177

178178
const Vector& CASW_Weapon_Autogun::GetBulletSpread( void )
179179
{
180-
static const Vector cone = Vector( 0.06105, 0.06105, 0.02); // VECTOR_CONE_7DEGREES with flattened Z
181-
static const Vector cone_duck = Vector( 0.03490, 0.03490, 0.01 ); // VECTOR_CONE_4DEGREES with flattened Z
180+
static const Vector cone = Vector( 0.06105, 0.02, 0.06105 ); // VECTOR_CONE_7DEGREES with flattened Y
181+
static const Vector cone_duck = Vector( 0.03490, 0.01, 0.03490 ); // VECTOR_CONE_4DEGREES with flattened Y
182182

183183
CASW_Marine *marine = GetMarine();
184184

src/game/shared/swarm/asw_weapon_deagle_shared.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ void CASW_Weapon_DEagle::ItemBusyFrame()
175175

176176
const Vector &CASW_Weapon_DEagle::GetBulletSpread( void )
177177
{
178-
const static Vector cone = Vector( 0.13053, 0.13053, 0.02 ); // VECTOR_CONE_15DEGREES with flattened Z
179-
const static Vector cone_duck = Vector( 0.05234, 0.05234, 0.01 ); // VECTOR_CONE_6DEGREES with flattened Z
178+
const static Vector cone = Vector( 0.13053, 0.02, 0.13053 ); // VECTOR_CONE_15DEGREES with flattened Y
179+
const static Vector cone_duck = Vector( 0.05234, 0.01, 0.05234 ); // VECTOR_CONE_6DEGREES with flattened Y
180180

181181
CASW_Marine *marine = GetMarine();
182182

src/game/shared/swarm/asw_weapon_heavy_rifle_shared.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,17 @@ float CASW_Weapon_Heavy_Rifle::GetFireRate()
153153

154154
const Vector &CASW_Weapon_Heavy_Rifle::GetBulletSpread( void )
155155
{
156-
const static Vector vec15degrees = Vector( 0.13053, 0.02618, 0.13053 ); // VECTOR_CONE_15DEGREES with y as VECTOR_CONE_3DEGREES
157-
const static Vector vec6degrees = Vector( 0.05234, 0.02618, 0.05234 ); // VECTOR_CONE_6DEGREES with y as VECTOR_CONE_3DEGREES
156+
const static Vector cone = Vector( 0.13053, 0.02, 0.13053 ); // VECTOR_CONE_15DEGREES with flattened Y
157+
const static Vector cone_duck = Vector( 0.05234, 0.01, 0.05234 ); // VECTOR_CONE_6DEGREES with flattened Y
158158

159159
CASW_Marine *marine = GetMarine();
160160

161161
if ( marine )
162162
{
163163
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking && !m_bFastFire )
164-
return vec6degrees;
164+
return cone_duck;
165165
}
166-
return vec15degrees;
166+
return cone;
167167
}
168168

169169
void CASW_Weapon_Heavy_Rifle::StopFastFire()

src/game/shared/swarm/asw_weapon_medrifle_shared.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,14 @@ void CASW_Weapon_MedRifle::WeaponIdle( void )
347347

348348
const Vector& CASW_Weapon_MedRifle::GetBulletSpread( void )
349349
{
350-
static const Vector cone = Vector( 0.13053, 0.13053, 0.02 ); // VECTOR_CONE_15DEGREES with flattened Z
351-
const static Vector cone_duck = Vector(0.05234, 0.05234, 0.01); // VECTOR_CONE_6DEGREES with flattened Z
350+
static const Vector cone = Vector( 0.13053, 0.02, 0.13053 ); // VECTOR_CONE_15DEGREES with flattened Y
351+
const static Vector cone_duck = Vector( 0.05234, 0.01, 0.05234 ); // VECTOR_CONE_6DEGREES with flattened Y
352352

353353
CASW_Marine* marine = GetMarine();
354354

355-
if (marine)
355+
if ( marine )
356356
{
357-
if (marine->GetLocalVelocity().IsZero() && marine->m_bWalking)
357+
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking )
358358
return cone_duck;
359359
}
360360
return cone;

src/game/shared/swarm/asw_weapon_minigun.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ int CASW_Weapon_Minigun::GetWeaponSubSkillId()
442442

443443
const Vector &CASW_Weapon_Minigun::GetBulletSpread( void )
444444
{
445-
const static Vector cone = Vector( 0.13053, 0.13053, 0.02 ); // VECTOR_CONE_15DEGREES with flattened Z
446-
const static Vector cone_duck = Vector( 0.05234, 0.05234, 0.01 ); // VECTOR_CONE_6DEGREES with flattened Z
445+
const static Vector cone = Vector( 0.13053, 0.02, 0.13053 ); // VECTOR_CONE_15DEGREES with flattened Y
446+
const static Vector cone_duck = Vector( 0.05234, 0.01, 0.05234 ); // VECTOR_CONE_6DEGREES with flattened Y
447447

448448
CASW_Marine *marine = GetMarine();
449449

src/game/shared/swarm/asw_weapon_shotgun_shared.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ CASW_Weapon_Shotgun::~CASW_Weapon_Shotgun()
141141

142142
const Vector& CASW_Weapon_Shotgun::GetBulletSpread( void )
143143
{
144-
static const Vector cone = VECTOR_CONE_20DEGREES;
145-
static const Vector cone_duck = VECTOR_CONE_15DEGREES;
144+
static const Vector cone = Vector( 0.17365, 0.02, 0.17365 ); // VECTOR_CONE_20DEGREES with flattened Y
145+
static const Vector cone_duck = Vector( 0.05234, 0.01, 0.05234 ); // VECTOR_CONE_6DEGREES with flattened Y
146146

147147
CASW_Marine* marine = GetMarine();
148148

@@ -156,8 +156,8 @@ const Vector& CASW_Weapon_Shotgun::GetBulletSpread( void )
156156

157157
const Vector& CASW_Weapon_Shotgun::GetAngularBulletSpread( void )
158158
{
159-
static const Vector cone( 22, 22, 12 );
160-
static const Vector cone_duck( 16, 16, 6 );
159+
static const Vector cone( 2, 22, 2 );
160+
static const Vector cone_duck( 6, 16, 6 );
161161

162162
CASW_Marine* marine = GetMarine();
163163

0 commit comments

Comments
 (0)