Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/game/server/swarm/asw_barrel_explosive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,19 @@ void CASW_Barrel_Explosive::ExplodeNow( const CTakeDamageInfo &info )

void CASW_Barrel_Explosive::DoExplosion()
{
// scorch the ground
trace_t tr;
UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + Vector( 0, 0, -80 ), MASK_SHOT,
this, COLLISION_GROUP_NONE, &tr);

if ((tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0))
// scorch decals
Vector vecForward = GetAbsVelocity();
float flTraceDist = 80.0f;
if ( vecForward.LengthSqr() < 0.001f )
vecForward = Vector( 0, 0, -1 );
VectorNormalize( vecForward );
trace_t tr;
UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + flTraceDist * vecForward, MASK_SHOT_HULL | CONTENTS_TRANSLUCENT, this, COLLISION_GROUP_NONE, &tr );

if ( ( tr.m_pEnt != GetWorldEntity() ) || ( tr.hitbox != 0 ) )
{
// non-world needs smaller decals
if( tr.m_pEnt && !tr.m_pEnt->IsNPC() )
if ( tr.m_pEnt )
{
UTIL_DecalTrace( &tr, "SmallScorch" );
}
Expand Down
13 changes: 9 additions & 4 deletions src/game/server/swarm/asw_firewall_piece.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ void CASW_Firewall_Piece::Spawn( void )
//pFire->SetAbsVelocity( vec3_origin );

trace_t tr;
UTIL_TraceHull( GetAbsOrigin() + Vector( 0.0f,0.0f, 5.0f), GetAbsOrigin() + Vector( 0.0f, 0.0f, -100.0f ),
Vector( -30.0f, -30.0f, 0.0f ), Vector( 30.0f, 30.0f, 30.0f ), MASK_SOLID_BRUSHONLY, this, COLLISION_GROUP_NONE, &tr );
UTIL_TraceHull( GetAbsOrigin() + Vector( 0.0f,0.0f, 32.0f), GetAbsOrigin() + Vector( 0.0f, 0.0f, -1000.0f ),
Vector( -30.0f, -30.0f, 0.0f ), Vector( 30.0f, 30.0f, 30.0f ), MASK_SHOT_HULL | CONTENTS_PLAYERCLIP | CONTENTS_MONSTERCLIP | CONTENTS_TRANSLUCENT, this, ASW_COLLISION_GROUP_IGNORE_NPCS, &tr );

int nFlags = ( SF_FIRE_START_ON | SF_FIRE_SMOKELESS );

Expand All @@ -100,6 +100,11 @@ void CASW_Firewall_Piece::Spawn( void )
if ( pFire )
{
pFire->m_bPlacedByMarine = m_bPlacedByMarine;

// scorch decals
trace_t tr2;
UTIL_TraceLine( tr.endpos + Vector( 0.0f, 0.0f, 32.0f ), tr.endpos + Vector( 0.0f, 0.0f, -60.0f ), MASK_SHOT_HULL | CONTENTS_TRANSLUCENT, this, ASW_COLLISION_GROUP_IGNORE_NPCS, &tr2 );
UTIL_DecalTrace( &tr2, "Scorch" );
}
}

Expand Down Expand Up @@ -170,7 +175,7 @@ CASW_Firewall_Piece* CASW_Firewall_Piece::CreateAnotherPiece(bool bRight)
ang.y-=90;
AngleVectors(ang, &offset);
offset *= ASW_FIREWALL_SPACING;
Vector start = GetAbsOrigin() + Vector(0,0,20);
Vector start = GetAbsOrigin() + Vector(0,0,32);
Vector dest = start + offset;
//todo: trace from abs to dest
trace_t tr;
Expand All @@ -193,7 +198,7 @@ CASW_Firewall_Piece* CASW_Firewall_Piece::CreateAnotherPiece(bool bRight)
//if (GetOwnerEntity())
//Msg("Creating another firewall piece with owner %s\n", GetOwnerEntity()->GetClassname());
//UTIL_SetOrigin( pFirewall, GetAbsOrigin() + offset );
pFirewall->SetAbsOrigin( dest - Vector(0,0,20) );
pFirewall->SetAbsOrigin( dest - Vector(0,0,32) );
pFirewall->SetDuration(m_fFireDuration);
pFirewall->m_hCreatorWeapon = m_hCreatorWeapon;
pFirewall->m_bPlacedByMarine = m_bPlacedByMarine;
Expand Down
26 changes: 15 additions & 11 deletions src/game/server/swarm/asw_grenade_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,21 +258,25 @@ CASW_Grenade_Cluster* CASW_Grenade_Cluster::Cluster_Grenade_Create( float flDama

void CASW_Grenade_Cluster::DoExplosion()
{
// scorch the ground
trace_t tr;
UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + Vector( 0, 0, -80 ), MASK_SHOT,
this, COLLISION_GROUP_NONE, &tr);

if (m_bMaster)
// scorch decals
//if (m_bMaster)
{
if ((tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0))
Vector vecForward = GetAbsVelocity();
float flTraceDist = 60.0f;
if ( vecForward.LengthSqr() < 0.001f )
vecForward = Vector( 0, 0, -1 );
VectorNormalize( vecForward );
trace_t tr;
UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + flTraceDist * vecForward, MASK_SHOT_HULL | CONTENTS_TRANSLUCENT, this, COLLISION_GROUP_NONE, &tr );

if ( ( tr.m_pEnt != GetWorldEntity() ) || ( tr.hitbox != 0 ) )
{
// non-world needs smaller decals
if( tr.m_pEnt && !tr.m_pEnt->IsNPC() )
{
UTIL_DecalTrace( &tr, "SmallScorch" );
if ( tr.m_pEnt )
{
UTIL_DecalTrace( &tr, "SmallScorch" );
}
}
}
else
{
UTIL_DecalTrace( &tr, "Scorch" );
Expand Down
22 changes: 12 additions & 10 deletions src/game/server/swarm/asw_grenade_vindicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,21 @@ void CASW_Grenade_Vindicator::Detonate()
m_flDamage );
*/

Vector vecForward = GetAbsVelocity();
VectorNormalize(vecForward);
trace_t tr;
UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + 60*vecForward, MASK_SHOT,
this, COLLISION_GROUP_NONE, &tr);


// scorch decals
if (m_bMaster)
{
if ((tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0))
Vector vecForward = GetAbsVelocity();
float flTraceDist = 60.0f;
if ( vecForward.LengthSqr() < 0.001f )
vecForward = Vector( 0, 0, -1 );
VectorNormalize( vecForward );
trace_t tr;
UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + flTraceDist * vecForward, MASK_SHOT_HULL | CONTENTS_TRANSLUCENT, this, COLLISION_GROUP_NONE, &tr );

if ( ( tr.m_pEnt != GetWorldEntity() ) || ( tr.hitbox != 0 ) )
{
// non-world needs smaller decals
if( tr.m_pEnt && !tr.m_pEnt->IsNPC() )
if ( tr.m_pEnt )
{
UTIL_DecalTrace( &tr, "SmallScorch" );
}
Expand All @@ -278,7 +280,7 @@ void CASW_Grenade_Vindicator::Detonate()
{
UTIL_DecalTrace( &tr, "Scorch" );
}

UTIL_DecalTrace( &tr, "Scorch" );
UTIL_ASW_ScreenShake( GetAbsOrigin(), 10.0, 150.0, 1.0, 750, SHAKE_START );
}

Expand Down
18 changes: 8 additions & 10 deletions src/game/server/swarm/asw_laser_mine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,14 @@ void CASW_Laser_Mine::SpawnFlipThink()

void CASW_Laser_Mine::Explode( bool bRemove )
{
// scorch the ground
trace_t tr;
UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + Vector( 0, 0, -80 ), MASK_SHOT,
this, COLLISION_GROUP_NONE, &tr);
// scorch decal
trace_t tr;
UTIL_TraceLine( GetAbsOrigin() + m_vecSurfaceNormal * 32.0f, GetAbsOrigin() - m_vecSurfaceNormal * 80.0f, MASK_SHOT_HULL | CONTENTS_TRANSLUCENT, this, COLLISION_GROUP_NONE, &tr );

if ((tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0))
if ( ( tr.m_pEnt != GetWorldEntity() ) || ( tr.hitbox != 0 ) )
{
// non-world needs smaller decals
if( tr.m_pEnt && !tr.m_pEnt->IsNPC() )
{
if ( tr.m_pEnt )
UTIL_DecalTrace( &tr, "SmallScorch" );
}
}
else
{
Expand Down Expand Up @@ -284,7 +280,9 @@ CASW_Laser_Mine* CASW_Laser_Mine::ASW_Laser_Mine_Create( const Vector &position,
{
CASW_Laser_Mine *pMine = (CASW_Laser_Mine*)CreateEntityByName( "asw_laser_mine" );
pMine->SetLaserAngle( angLaserAim );


AngleVectors( angles, nullptr, nullptr, &pMine->m_vecSurfaceNormal );

matrix3x4_t wallMatrix;
AngleMatrix( angles, wallMatrix );

Expand Down
1 change: 1 addition & 0 deletions src/game/server/swarm/asw_laser_mine.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class CASW_Laser_Mine : public CBaseCombatCharacter, public IEntityListener, pub
bool m_bIsSpawnLanded;
float m_flSpawnFlipStartTime;
float m_flSpawnFlipEndTime;
Vector m_vecSurfaceNormal;
Vector m_vecSpawnFlipStartPos;
Vector m_vecSpawnFlipEndPos;
QAngle m_angSpawnFlipEndAngle;
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/swarm/asw_alien_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void CASW_Alien::DoBloodDecal( float flDamage, const Vector &vecPos, const Vecto
vecTraceDir.z += random->RandomFloat( -flNoise, flNoise );

// Don't bleed on grates.
UTIL_TraceLine( vecPos, vecPos + vecTraceDir * -flTraceDist, MASK_SOLID_BRUSHONLY & ~CONTENTS_GRATE, this, COLLISION_GROUP_NONE, &Bloodtr);
UTIL_TraceLine( vecPos, vecPos + vecTraceDir * -flTraceDist, MASK_SHOT_HULL | CONTENTS_TRANSLUCENT, this, COLLISION_GROUP_NONE, &Bloodtr);

if ( Bloodtr.fraction != 1.0 )
{
Expand Down
2 changes: 2 additions & 0 deletions src/game/shared/swarm/asw_weapon_laser_mines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ void CASW_Weapon_Laser_Mines::DelayedAttack( void )
RotationDelta( angFacing, angLaser, &angLaserOffset );

CASW_Laser_Mine *pMine = CASW_Laser_Mine::ASW_Laser_Mine_Create( tr.endpos, angFacing, angLaserOffset, pMarine, pParent, true, this );
pMine->m_vecSurfaceNormal = tr.plane.normal;

IGameEvent * event = gameeventmanager->CreateEvent( "laser_mine_placed" );
if ( event )
{
Expand Down