Skip to content

Commit

Permalink
Remove clutter client logging in melee scripts (#895)
Browse files Browse the repository at this point in the history
Removes logging print statements that just clutter up console.
  • Loading branch information
NachosChipeados authored Nov 14, 2024
1 parent e75be3d commit 227e7ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 79 deletions.
32 changes: 1 addition & 31 deletions Northstar.Custom/mod/scripts/vscripts/melee/sh_melee.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,6 @@ bool function CodeCallback_IsValidMeleeAttackTarget( entity attacker, entity tar

void function CodeCallback_OnMeleePressed( entity player )
{
#if SERVER
print( "SERVER: " + player + " pressed melee\n" )
#else
print( "CLIENT: " + player + " pressed melee\n" )
#endif

if ( !Melee_IsAllowed( player ) )
{
Expand Down Expand Up @@ -410,24 +405,10 @@ void function CodeCallback_OnMeleePressed( entity player )
}

if ( player.PlayerMelee_GetState() != PLAYER_MELEE_STATE_NONE )
{
#if SERVER
print( "SERVER: PlayerMelee_GetState() for " + player + " is " + player.PlayerMelee_GetState() + "\n" )
#else
print( "CLIENT: PlayerMelee_GetState() for " + player + " is " + player.PlayerMelee_GetState() + "\n" )
#endif
return
}

if ( !IsAlive( player ) )
{
#if SERVER
print( "SERVER: " + player + " is dead\n" )
#else
print( "CLIENT: " + player + " is dead\n" )
#endif
return
}

thread CodeCallback_OnMeleePressed_InternalThread( player )
}
Expand Down Expand Up @@ -527,14 +508,7 @@ bool function PlayerTriesSyncedMelee( entity player, entity target )
}

if ( !player.Lunge_IsActive() || !player.Lunge_IsGroundExecute() || !player.Lunge_IsLungingToEntity() || (player.Lunge_GetTargetEntity() != target) )
{
#if SERVER
print( "SERVER: " + player + " is calling Lunge_SetTargetEntity() from PlayerTriesSyncedMelee()\n" )
#else
print( "CLIENT: " + player + " is calling Lunge_SetTargetEntity() from PlayerTriesSyncedMelee()\n" )
#endif
player.Lunge_SetTargetEntity( target, false )
}

#if SERVER
OnThreadEnd(
Expand Down Expand Up @@ -1024,11 +998,7 @@ SyncedMeleeChooser ornull function GetSyncedMeleeChooserForPlayerVsTarget( entit
void function CodeCallback_OnMeleeAttackAnimEvent( entity player )
{
Assert( IsValid( player ) )
#if SERVER
print( "SERVER: " + player + " is calling CodeCallback_OnMeleeAttackAnimEvent()\n" )
#else
print( "CLIENT: " + player + " is calling CodeCallback_OnMeleeAttackAnimEvent()\n" )
#endif

if ( player.PlayerMelee_IsAttackActive() )
{
if ( player.IsTitan() )
Expand Down
48 changes: 0 additions & 48 deletions Northstar.Custom/mod/scripts/vscripts/melee/sh_melee_human.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ function HumanUnsyncedMelee( entity player, bool movestunBlocked )
{
if ( !movestunBlocked )
{
#if SERVER
print( "SERVER: " + player + " is calling Lunge_SetTargetEntity() from HumanUnsyncedMelee()\n" )
#else
print( "CLIENT: " + player + " is calling Lunge_SetTargetEntity() from HumanUnsyncedMelee()\n" )
#endif
if ( player.Lunge_SetTargetEntity( lungeTarget, true ) )
{
if ( lungeTarget.IsTitan() )
Expand Down Expand Up @@ -95,11 +90,6 @@ function HumanUnsyncedMelee( entity player, bool movestunBlocked )

function DoReactionForTitanHit( entity player, entity titan )
{
#if SERVER
print( "SERVER: " + player + " is calling Lunge_SetTargetEntity() from DoReactionForTitanHit()\n" )
#else
print( "CLIENT: " + player + " is calling Lunge_SetTargetEntity() from DoReactionForTitanHit()\n" )
#endif
player.Lunge_SetTargetEntity( titan, true )
if ( player.Lunge_IsLungingToEntity() )
player.Lunge_EnableFlying()
Expand All @@ -125,29 +115,11 @@ function HumanMeleeAttack( entity player )
if ( player.Lunge_IsGroundExecute() )
attackRange = 150

#if SERVER
print( "SERVER: " + player + " is calling PlayerMelee_AttackTrace() from HumanMeleeAttack()\n" )
#else
print( "CLIENT: " + player + " is calling PlayerMelee_AttackTrace() from HumanMeleeAttack()\n" )
#endif
table traceResult = PlayerMelee_AttackTrace( player, attackRange, CodeCallback_IsValidMeleeAttackTarget )

entity hitEnt = expect entity( traceResult.ent )
if ( !IsValid( hitEnt ) )
{
#if SERVER
print( "SERVER: " + player + " call to PlayerMelee_AttackTrace() did NOT hit\n" )
#else
print( "CLIENT: " + player + " call to PlayerMelee_AttackTrace() did NOT hit\n" )
#endif
return
}

#if SERVER
print( "SERVER: " + player + " call to PlayerMelee_AttackTrace() hit " + hitEnt + "\n" )
#else
print( "CLIENT: " + player + " call to PlayerMelee_AttackTrace() hit " + hitEnt + "\n" )
#endif

if ( PlayerMelee_IsServerSideEffects() )
{
Expand Down Expand Up @@ -231,8 +203,6 @@ function HumanMeleeAttack_DoImpact( entity player, entity meleeWeapon, traceResu
vector oldVelocity = target.GetVelocity()
vector damageForce = AnglesToForward( angles ) * meleeWeapon.GetWeaponDamageForce()

print( "SERVER: HumanMeleeAttack_DoImpact() applying damage to " + target + "\n" )

if ( target.IsNPC() && target.CanBeGroundExecuted() )
target.TakeDamage( target.GetHealth(), player, player, { scriptType = DF_RAGDOLL | meleeWeapon.GetWeaponDamageFlags(), damageType = DMG_MELEE_ATTACK, damageSourceId = damageSource, origin = traceResult.position, force = Vector( 0, 0, 0 ) } )
else
Expand Down Expand Up @@ -511,28 +481,10 @@ bool function AttemptHumanMeleeExecution( entity player, entity syncedTarget, en

void function PlayerTriesSyncedMelee_FallbackToHumanMeleeAttack( entity player, entity target, entity meleeWeapon, table traceResult )
{
#if SERVER
print( "SERVER: PlayerTriesSyncedMelee_FallbackToHumanMeleeAttack() for " + player + "\n" )
#else
print( "CLIENT: PlayerTriesSyncedMelee_FallbackToHumanMeleeAttack() for " + player + "\n" )
#endif
if ( !PlayerTriesSyncedMelee( player, target ) )
{
#if SERVER
print( "SERVER: PlayerTriesSyncedMelee() for " + player + " failed\n" )
#else
print( "CLIENT: PlayerTriesSyncedMelee() for " + player + " failed\n" )
#endif
#if SERVER
HumanMeleeAttack_DoImpact( player, meleeWeapon, traceResult )
#endif
}
else
{
#if SERVER
print( "SERVER: PlayerTriesSyncedMelee() for " + player + " succeeded\n" )
#else
print( "CLIENT: PlayerTriesSyncedMelee() for " + player + " succeeded\n" )
#endif
}
}

0 comments on commit 227e7ef

Please sign in to comment.