Skip to content

Commit

Permalink
even more stuff
Browse files Browse the repository at this point in the history
added thirdpartylegalnotices.txt and source sdk license which i just noticed were missing
text messages now appear for fail events like allies dying
expanded map lists for Teleporter Bullets and Player Teleport
fixed hopper mines being impossible to pick up when Fast Physics is on
fixed being able to reload shotgun when No One Can Reload is on
NPCs now aim upward to account for gravity when firing grenades due to Grenade Guns
  • Loading branch information
Pinsplash committed Apr 30, 2023
1 parent 3a04bc8 commit 0f43e03
Show file tree
Hide file tree
Showing 92 changed files with 990 additions and 65 deletions.
43 changes: 43 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
SOURCE 1 SDK LICENSE

Source SDK Copyright(c) Valve Corp.

THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE
CORPORATION ("Valve"). PLEASE READ IT BEFORE DOWNLOADING OR USING
THE SOURCE ENGINE SDK ("SDK"). BY DOWNLOADING AND/OR USING THE
SOURCE ENGINE SDK YOU ACCEPT THIS LICENSE. IF YOU DO NOT AGREE TO
THE TERMS OF THIS LICENSE PLEASE DON�T DOWNLOAD OR USE THE SDK.

You may, free of charge, download and use the SDK to develop a modified Valve game
running on the Source engine. You may distribute your modified Valve game in source and
object code form, but only for free. Terms of use for Valve games are found in the Steam
Subscriber Agreement located here: http://store.steampowered.com/subscriber_agreement/

You may copy, modify, and distribute the SDK and any modifications you make to the
SDK in source and object code form, but only for free. Any distribution of this SDK must
include this LICENSE file and thirdpartylegalnotices.txt.

Any distribution of the SDK or a substantial portion of the SDK must include the above
copyright notice and the following:

DISCLAIMER OF WARRANTIES. THE SOURCE SDK AND ANY
OTHER MATERIAL DOWNLOADED BY LICENSEE IS PROVIDED
"AS IS". VALVE AND ITS SUPPLIERS DISCLAIM ALL
WARRANTIES WITH RESPECT TO THE SDK, EITHER EXPRESS
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED
WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT,
TITLE AND FITNESS FOR A PARTICULAR PURPOSE.

LIMITATION OF LIABILITY. IN NO EVENT SHALL VALVE OR
ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER
(INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
ARISING OUT OF THE USE OF OR INABILITY TO USE THE
ENGINE AND/OR THE SDK, EVEN IF VALVE HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


If you would like to use the SDK for a commercial purpose, please contact Valve at
[email protected].
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_brazilian.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_bulgarian.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_czech.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_danish.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_dutch.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_english.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_finnish.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_french.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_german.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_greek.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_hungarian.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_italian.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_japanese.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_korean.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_koreana.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_latam.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_norwegian.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_polish.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_portuguese.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_romanian.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_russian.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_schinese.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_spanish.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_swedish.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_tchinese.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_thai.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_turkish.txt
Binary file not shown.
Binary file modified sourcemods/ep1chaos/resource/ep1chaos_ukrainian.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_brazilian.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_bulgarian.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_czech.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_danish.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_dutch.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_english.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_finnish.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_french.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_german.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_greek.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_hungarian.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_italian.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_japanese.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_korean.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_koreana.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_latam.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_norwegian.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_polish.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_portuguese.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_romanian.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_russian.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_schinese.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_spanish.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_swedish.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_tchinese.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_thai.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_turkish.txt
Binary file not shown.
Binary file modified sourcemods/ep2chaos/resource/ep2chaos_ukrainian.txt
Binary file not shown.
8 changes: 4 additions & 4 deletions sourcemods/ep2chaos/scripts/titles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,22 @@ $fadeout 1.5

GAMEOVER_ALLY
{
#HL2_GameOver_Ally
#HL2chaos_GameOver_Ally
}

GAMEOVER_OBJECT
{
#HL2_GameOver_Object
#HL2chaos_GameOver_Object
}

GAMEOVER_TIMER
{
#HL2_GameOver_Timer
#HL2chaos_GameOver_Timer
}

GAMEOVER_STUCK
{
#HL2_GameOver_Stuck
#HL2chaos_GameOver_Stuck
}

GAMEOVER_ALYXDEAD
Expand Down
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_brazilian.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_bulgarian.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_czech.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_danish.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_dutch.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_english.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_finnish.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_french.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_german.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_greek.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_hungarian.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_italian.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_japanese.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_korean.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_koreana.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_latam.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_norwegian.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_polish.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_portuguese.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_romanian.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_russian.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_schinese.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_spanish.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_swedish.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_tchinese.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_thai.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_turkish.txt
Binary file not shown.
Binary file modified sourcemods/hl2chaos/resource/hl2chaos_ukrainian.txt
Binary file not shown.
8 changes: 4 additions & 4 deletions sourcemods/hl2chaos/scripts/titles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,22 @@ $fadeout 1.5

GAMEOVER_ALLY
{
#HL2_GameOver_Ally
#HL2chaos_GameOver_Ally
}

GAMEOVER_OBJECT
{
#HL2_GameOver_Object
#HL2chaos_GameOver_Object
}

GAMEOVER_TIMER
{
#HL2_GameOver_Timer
#HL2chaos_GameOver_Timer
}

GAMEOVER_STUCK
{
#HL2_GameOver_Stuck
#HL2chaos_GameOver_Stuck
}


Expand Down
22 changes: 16 additions & 6 deletions sp/src/game/server/hl2/hl2_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5257,11 +5257,20 @@ bool CChaosEffect::CheckEffectContext()
return false;//bad map

//avoid maps that need striders or other NPCs to not teleport to god-knows-where
//d3_c17_11 have to kill gunship
//d3_c17_12b have to kill strider
//d3_c17_13 have to kill striders
//ep1_c17_00a alyx can become lost?
//ep1_c17_05 have to kill sniper and APC
//ep1_c17_06 have to kill strider
//ep2_outland_01 alyx can become lost?
//ep2_outland_08 have to kill helicopter
//ep2_outland_12 have to kill striders
if (m_nID == EFFECT_BULLET_TELEPORT)
if (!Q_strcmp(pMapName, "d3_c17_12b") || !Q_strcmp(pMapName, "d3_c17_13")
if (!Q_strcmp(pMapName, "d3_c17_11") || !Q_strcmp(pMapName, "d3_c17_12b") || !Q_strcmp(pMapName, "d3_c17_13")
|| !Q_strcmp(pMapName, "ep1_c17_00a") || !Q_strcmp(pMapName, "ep1_c17_05") || !Q_strcmp(pMapName, "ep1_c17_06")
|| !Q_strcmp(pMapName, "ep2_outland_01") || !Q_strcmp(pMapName, "ep2_outland_08") || !Q_strcmp(pMapName, "ep2_outland_08") || !Q_strcmp(pMapName, "ep2_outland_12"))
return false;//if striders get lost on this map, we softlock or near softlock
|| !Q_strcmp(pMapName, "ep2_outland_01") || !Q_strcmp(pMapName, "ep2_outland_08") || !Q_strcmp(pMapName, "ep2_outland_12"))
return false;

//avoid maps that would poorly fit a crane
if (m_nID == EFFECT_EVIL_NORIKO)
Expand All @@ -5279,12 +5288,13 @@ bool CChaosEffect::CheckEffectContext()
return false;//no sir no shotguns here

//Don't remove pickups on these maps
//ts05 suit has to be picked up to progress cutscene
//d1_trainstation_05 suit to progress cutscene
//d2_coast_10 rocket crate for gunship
//d2_prison_01 rocket crate for gunships
//d3_c17_09 grenades to save barney
//d3_c17_10b explosives for ground turrets
//d3_c17_11 rocket crate for shooting gunship
//ep1_c17_00 pistol and shotgun to shoot lock
//ep1_c17_00a too hard
//ep1_c17_05 rocket crate for shooting sniper
//ep1_c17_06 rocket crate for shooting strider
//ep2_outland_02 too hard
Expand Down Expand Up @@ -5400,7 +5410,7 @@ bool CChaosEffect::CheckEffectContext()
|| !Q_strcmp(pMapName, "d1_town_02a") || !Q_strcmp(pMapName, "d1_town_05")
|| !Q_strcmp(pMapName, "d2_coast_11")
|| !Q_strcmp(pMapName, "d2_prison_06") || !Q_strcmp(pMapName, "d2_prison_08")
|| !Q_strcmp(pMapName, "d3_c17_10b")
|| !Q_strcmp(pMapName, "d3_c17_06b") || !Q_strcmp(pMapName, "d3_c17_10b")
|| !Q_strcmp(pMapName, "d3_citadel_03") || !Q_strcmp(pMapName, "d3_citadel_04")
|| !Q_strcmp(pMapName, "d3_breen_01")
|| !Q_strcmp(pMapName, "ep1_citadel_03") || !Q_strcmp(pMapName, "ep1_c17_00") || !Q_strcmp(pMapName, "ep1_c17_00a")
Expand Down
72 changes: 30 additions & 42 deletions sp/src/game/server/hl2/weapon_physcannon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2739,81 +2739,74 @@ CBaseEntity *CWeaponPhysCannon::FindObjectInCone( const Vector &vecOrigin, const
//-----------------------------------------------------------------------------
bool CGrabController::UpdateObject( CBasePlayer *pPlayer, float flError )
{
CBaseEntity *pEntity = GetAttached();
CBaseEntity *pEntity = GetAttached();
//LOAD BEARING ERROR COMPUTATION
//this alters a time-based variable. if phys_timescale is not 1, that variable may not behave as desired. we alter phys_timescale in chaos.
//if we don't do this, hopper mines cannot be picked up.
//i don't fully get how this works
ComputeError();
if ( !pEntity || ComputeError() > flError || pPlayer->GetGroundEntity() == pEntity || !pEntity->VPhysicsGetObject() )
{
return false;
}

//Adrian: Oops, our object became motion disabled, let go!
IPhysicsObject *pPhys = pEntity->VPhysicsGetObject();
if ( pPhys && pPhys->IsMoveable() == false )
{
return false;
}

Vector forward, right, up;
QAngle playerAngles = pPlayer->EyeAngles();
AngleVectors( playerAngles, &forward, &right, &up );

AngleVectors(playerAngles, &forward, &right, &up);
if ( HL2GameRules()->MegaPhyscannonActive() )
{
Vector los = ( pEntity->WorldSpaceCenter() - pPlayer->Weapon_ShootPosition() );
VectorNormalize( los );
Vector los = (pEntity->WorldSpaceCenter() - pPlayer->Weapon_ShootPosition());
VectorNormalize(los);

float flDot = DotProduct( los, forward );
float flDot = DotProduct(los, forward);

//Let go of the item if we turn around too fast.
if ( flDot <= 0.35f )
if (flDot <= 0.35f)
{
return false;
}
}

float pitch = AngleDistance(playerAngles.x,0);

float pitch = AngleDistance(playerAngles.x, 0);
if( !m_bAllowObjectOverhead )
{
playerAngles.x = clamp( pitch, -75, 75 );
playerAngles.x = clamp(pitch, -75, 75);
}
else
{
playerAngles.x = clamp( pitch, -90, 75 );
playerAngles.x = clamp(pitch, -90, 75);
}



// Now clamp a sphere of object radius at end to the player's bbox
Vector radial = physcollision->CollideGetExtent( pPhys->GetCollide(), vec3_origin, pEntity->GetAbsAngles(), -forward );
Vector radial = physcollision->CollideGetExtent(pPhys->GetCollide(), vec3_origin, pEntity->GetAbsAngles(), -forward);
Vector player2d = pPlayer->CollisionProp()->OBBMaxs();
float playerRadius = player2d.Length2D();
float radius = playerRadius + fabs(DotProduct( forward, radial ));

float distance = 24 + ( radius * 2.0f );

float radius = playerRadius + fabs(DotProduct(forward, radial));
float distance = 24 + (radius * 2.0f);
// Add the prop's distance offset
distance += m_flDistanceOffset;

Vector start = pPlayer->Weapon_ShootPosition();
Vector end = start + ( forward * distance );

Vector end = start + (forward * distance);
trace_t tr;
CTraceFilterSkipTwoEntities traceFilter( pPlayer, pEntity, COLLISION_GROUP_NONE );
Ray_t ray;
ray.Init( start, end );
enginetrace->TraceRay( ray, MASK_SOLID_BRUSHONLY, &traceFilter, &tr );

enginetrace->TraceRay(ray, MASK_SOLID_BRUSHONLY, &traceFilter, &tr);
if ( tr.fraction < 0.5 )
{
end = start + forward * (radius*0.5f);
}
else if ( tr.fraction <= 1.0f )
{
end = start + forward * ( distance - radius );
end = start + forward * (distance - radius);
}
Vector playerMins, playerMaxs, nearest;
pPlayer->CollisionProp()->WorldSpaceAABB( &playerMins, &playerMaxs );
pPlayer->CollisionProp()->WorldSpaceAABB(&playerMins, &playerMaxs);
Vector playerLine = pPlayer->CollisionProp()->WorldSpaceCenter();
CalcClosestPointOnLine( end, playerLine+Vector(0,0,playerMins.z), playerLine+Vector(0,0,playerMaxs.z), nearest, NULL );

CalcClosestPointOnLine(end, playerLine + Vector(0, 0, playerMins.z), playerLine + Vector(0, 0, playerMaxs.z), nearest, NULL);
if( !m_bAllowObjectOverhead )
{
Vector delta = end - nearest;
Expand All @@ -2823,7 +2816,6 @@ bool CGrabController::UpdateObject( CBasePlayer *pPlayer, float flError )
end = nearest + radius * delta;
}
}

//Show overlays of radius
if ( g_debug_physcannon.GetBool() )
{
Expand All @@ -2836,27 +2828,23 @@ bool CGrabController::UpdateObject( CBasePlayer *pPlayer, float flError )
true,
0.0f );
}

QAngle angles = TransformAnglesFromPlayerSpace( m_attachedAnglesPlayerSpace, pPlayer );

QAngle angles = TransformAnglesFromPlayerSpace(m_attachedAnglesPlayerSpace, pPlayer);
// If it has a preferred orientation, update to ensure we're still oriented correctly.
Pickup_GetPreferredCarryAngles( pEntity, pPlayer, pPlayer->EntityToWorldTransform(), angles );

Pickup_GetPreferredCarryAngles(pEntity, pPlayer, pPlayer->EntityToWorldTransform(), angles);
// We may be holding a prop that has preferred carry angles
if ( m_bHasPreferredCarryAngles )
{
matrix3x4_t tmp;
ComputePlayerMatrix( pPlayer, tmp );
angles = TransformAnglesToWorldSpace( m_vecPreferredCarryAngles, tmp );
ComputePlayerMatrix(pPlayer, tmp);
angles = TransformAnglesToWorldSpace(m_vecPreferredCarryAngles, tmp);
}

matrix3x4_t attachedToWorld;
Vector offset;
AngleMatrix( angles, attachedToWorld );
VectorRotate( m_attachedPositionObjectSpace, attachedToWorld, offset );

SetTargetPosition( end - offset, angles );
VectorRotate(m_attachedPositionObjectSpace, attachedToWorld, offset);

SetTargetPosition(end - offset, angles);
return true;
}

Expand Down
5 changes: 5 additions & 0 deletions sp/src/game/server/hl2/weapon_shotgun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

extern ConVar sk_auto_reload_time;
extern ConVar sk_plr_num_shotgun_pellets;
extern ConVar chaos_no_reload;

ConVar chaos_barrel_shotgun("chaos_barrel_shotgun", "0");

Expand Down Expand Up @@ -292,6 +293,8 @@ float CWeaponShotgun::GetFireRate()
//-----------------------------------------------------------------------------
bool CWeaponShotgun::StartReload( void )
{
if (chaos_no_reload.GetBool())
return false;
CBaseCombatCharacter *pOwner = GetOwner();

if ( pOwner == NULL )
Expand Down Expand Up @@ -338,6 +341,8 @@ bool CWeaponShotgun::StartReload( void )
bool CWeaponShotgun::Reload( void )
{
// Check that StartReload was called first
if (chaos_no_reload.GetBool())
return false;
if (!m_bInReload)
{
Warning("ERROR: Shotgun Reload called incorrectly!\n");
Expand Down
27 changes: 18 additions & 9 deletions sp/src/game/shared/baseentity_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,32 +1737,41 @@ void CBaseEntity::FireBullets( const FireBulletsInfo_t &info )
pBolt->SetAbsVelocity(vecDir * BOLT_AIR_VELOCITY);
}
}*/
if (IsPlayer() && info.m_iShots > 1 && iShot % 2)
{
// Half of the shotgun pellets are hulls that make it easier to hit targets with the shotgun.
AI_TraceHull(info.m_vecSrc, vecEnd, Vector(-3, -3, -3), Vector(3, 3, 3), MASK_SHOT, &traceFilter, &tr);
}
else
{
AI_TraceLine(info.m_vecSrc, vecEnd, MASK_SHOT, &traceFilter, &tr);
}

#ifndef CLIENT_DLL
//QAngle angAiming;
//VectorAngles(vecEnd, angAiming);
if (chaos_replace_bullets_with_grenades.GetBool())
{
Vector vecMins = -Vector(4, 4, 4);
Vector vecMaxs = Vector(4, 4, 4);
float flForceScale = 80;
float flForceFracBoost = 3;
float flForce = max(pAmmoDef->NPCDamage(info.m_iAmmoType), max(pAmmoDef->PlrDamage(info.m_iAmmoType), max(info.m_iPlayerDamage, info.m_flDamage))) * flForceScale;
//Msg("%0.1f * %0.1f = %0.1f\n", flForce / flForceScale, flForceScale, flForce);
flForce *= flForceFracBoost;
//Msg("* %0.1f = %0.1f\n", flForceFracBoost, flForce);
if (!IsPlayer())
{
//NPCs need to be told to shoot upwards when fighting long range
Vector vecAimUp = VecCheckThrow(this, info.m_vecSrc, tr.endpos, flForce, 1.0, &vecMins, &vecMaxs);
if (vecAimUp != vec3_origin)
vecDir = vecAimUp;
}
Fraggrenade_Create(info.m_vecSrc, vec3_angle, vecDir * flForce, AngularImpulse(600, random->RandomInt(-1200, 1200), 0), pAttacker, 3, false);
iSeed++;
continue;
}
#endif
if( IsPlayer() && info.m_iShots > 1 && iShot % 2 )
{
// Half of the shotgun pellets are hulls that make it easier to hit targets with the shotgun.
AI_TraceHull( info.m_vecSrc, vecEnd, Vector( -3, -3, -3 ), Vector( 3, 3, 3 ), MASK_SHOT, &traceFilter, &tr );
}
else
{
AI_TraceLine(info.m_vecSrc, vecEnd, MASK_SHOT, &traceFilter, &tr);
}
// Tracker 70354/63250: ywb 8/2/07
// Fixes bug where trace from turret with attachment point outside of Vcollide
// starts solid so doesn't hit anything else in the world and the final coord
Expand Down
Loading

0 comments on commit 0f43e03

Please sign in to comment.