Raised This Month: $51 Target: $400
 12% 

L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Smoak
Junior Member
Join Date: Dec 2019
Location: Maine
Old 09-28-2020 , 03:36   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#171

Quote:
Originally Posted by NiTro1 View Post
Here i use this version in Versus and its working fine.
It just doesn't work my man. We'll have to fix one of these mods to work, since I'm not sure what version you're using, but for the one i'm trying to use it just refuses to cooperate. If it helps, I downloaded the most recent version of sourcemod.

Last edited by Smoak; 09-28-2020 at 03:39.
Smoak is offline
Accelerator
Senior Member
Join Date: Dec 2010
Location: Russia
Old 09-28-2020 , 04:00   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#172

What events do you think these functions can be called upon?
Code:
//-----------------------------------------------------------------------------
// Purpose: Returns whether the player should autoaim or not
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CBasePlayer::ShouldAutoaim( void )
{
	// cannot be in multiplayer
	if ( gpGlobals->maxClients > 1 )
		return false;

	// autoaiming is only for easy and medium skill
	return ( IsX360() || !g_pGameRules->IsSkillLevel(SKILL_HARD) );
}

void CBasePlayer::GetAutoaimVector( autoaim_params_t &params )
{
	// Assume autoaim will not be assisting.
	params.m_bAutoAimAssisting = false;

	if ( ( ShouldAutoaim() == false ) || ( params.m_fScale == AUTOAIM_SCALE_DIRECT_ONLY ) )
	{
		Vector	forward;
		AngleVectors( EyeAngles() + m_Local.m_vecPunchAngle, &forward );

		params.m_vecAutoAimDir = forward;
		params.m_hAutoAimEntity.Set(NULL);
		params.m_vecAutoAimPoint = vec3_invalid;
		params.m_bAutoAimAssisting = false;
		return; /************* CRASH *************/
	}

	Vector vecSrc	= Weapon_ShootPosition( );

	m_vecAutoAim.Init( 0.0f, 0.0f, 0.0f );

	QAngle angles = AutoaimDeflection( vecSrc, params );

	// update ontarget if changed
	if ( !g_pGameRules->AllowAutoTargetCrosshair() )
		m_fOnTarget = false;

	if (angles.x > 180)
		angles.x -= 360;
	if (angles.x < -180)
		angles.x += 360;
	if (angles.y > 180)
		angles.y -= 360;
	if (angles.y < -180)
		angles.y += 360;

	if (angles.x > 25)
		angles.x = 25;
	if (angles.x < -25)
		angles.x = -25;
	if (angles.y > 12)
		angles.y = 12;
	if (angles.y < -12)
		angles.y = -12;

	Vector	forward;

	if( IsInAVehicle() && g_pGameRules->GetAutoAimMode() == AUTOAIM_ON_CONSOLE )
	{
		m_vecAutoAim = angles;
		AngleVectors( EyeAngles() + m_vecAutoAim, &forward );
	}
	else
	{
		// always use non-sticky autoaim
		m_vecAutoAim = angles * 0.9f;
		AngleVectors( EyeAngles() + m_Local.m_vecPunchAngle + m_vecAutoAim, &forward );
	}

	params.m_vecAutoAimDir = forward;
}

QAngle CBasePlayer::AutoaimDeflection( Vector &vecSrc, autoaim_params_t &params )
{
	float		bestscore;
	float		score;
	QAngle		eyeAngles;
	Vector		bestdir;
	CBaseEntity	*bestent;
	trace_t		tr;
	Vector		v_forward, v_right, v_up;

	if ( ShouldAutoaim() == false )
	{
		m_fOnTarget = false;
		return vec3_angle;
	}

	eyeAngles = EyeAngles();
	AngleVectors( eyeAngles + m_Local.m_vecPunchAngle + m_vecAutoAim, &v_forward, &v_right, &v_up );

	// try all possible entities
	bestdir = v_forward;
	bestscore = 0.0f;
	bestent = NULL;

	//Reset this data
	m_fOnTarget					= false;
	params.m_bOnTargetNatural	= false;
	
	CBaseEntity *pIgnore = NULL;

	if( IsInAVehicle() )
	{
		pIgnore = GetVehicleEntity();
	}

	CTraceFilterSkipTwoEntities traceFilter( this, pIgnore, COLLISION_GROUP_NONE );

	UTIL_TraceLine( vecSrc, vecSrc + bestdir * MAX_COORD_FLOAT, MASK_SHOT, &traceFilter, &tr );

	CBaseEntity *pEntHit = tr.m_pEnt;

	if ( pEntHit && pEntHit->m_takedamage != DAMAGE_NO && pEntHit->GetHealth() > 0 )
	{
		// don't look through water
		if (!((GetWaterLevel() != 3 && pEntHit->GetWaterLevel() == 3) || (GetWaterLevel() == 3 && pEntHit->GetWaterLevel() == 0)))
		{
			if( pEntHit->ShouldAttractAutoAim(this) )
			{
				bool bAimAtThis = true;

				if( pEntHit->IsNPC() && g_pGameRules->GetAutoAimMode() > AUTOAIM_NONE )
				{
					int iRelationType = GetDefaultRelationshipDisposition( pEntHit->Classify() );

					if( iRelationType != D_HT )
					{
						bAimAtThis = false;
					}
				}

				if( bAimAtThis )
				{
					if ( pEntHit->GetFlags() & FL_AIMTARGET )
					{
						m_fOnTarget = true;
					}

					// Player is already on target naturally, don't autoaim.
					// Fill out the autoaim_params_t struct, though.
					params.m_hAutoAimEntity.Set(pEntHit);
					params.m_vecAutoAimDir = bestdir;
					params.m_vecAutoAimPoint = tr.endpos;
					params.m_bAutoAimAssisting = false;
					params.m_bOnTargetNatural = true;
					return vec3_angle;
				}
			}

			//Fall through and look for an autoaim ent.
		}
	}

	int count = AimTarget_ListCount();
	if ( count )
	{
		CBaseEntity **pList = (CBaseEntity **)stackalloc( sizeof(CBaseEntity *) * count );
		AimTarget_ListCopy( pList, count );

		for ( int i = 0; i < count; i++ )
		{
			Vector center;
			Vector dir;
			CBaseEntity *pEntity = pList[i];

			// Don't autoaim at anything that doesn't want to be.
			if( !pEntity->ShouldAttractAutoAim(this) )
				continue;

			// Don't shoot yourself
			if ( pEntity == this )
				continue;

			if ( (pEntity->IsNPC() && !pEntity->IsAlive()) || !pEntity->edict() )
				continue;

			if ( !g_pGameRules->ShouldAutoAim( this, pEntity->edict() ) )
				continue;

			// don't look through water
			if ((GetWaterLevel() != 3 && pEntity->GetWaterLevel() == 3) || (GetWaterLevel() == 3 && pEntity->GetWaterLevel() == 0))
				continue;

			if( pEntity->MyNPCPointer() )
			{
				// If this entity is an NPC, only aim if it is an enemy.
				if ( IRelationType( pEntity ) != D_HT )
				{
					if ( !pEntity->IsPlayer() && !g_pGameRules->IsDeathmatch())
						// Msg( "friend\n");
						continue;
				}
			}

			// Don't autoaim at the noisy bodytarget, this makes the autoaim crosshair wobble.
			//center = pEntity->BodyTarget( vecSrc, false );
			center = pEntity->WorldSpaceCenter();

			dir = (center - vecSrc);
			
			float dist = dir.Length2D();
			VectorNormalize( dir );

			// Skip if out of range.
			if( dist > params.m_fMaxDist )
				continue;

			float dot = DotProduct (dir, v_forward );

			// make sure it's in front of the player
			if( dot < 0 )
				continue;

			if( !(pEntity->GetFlags() & FL_FLY) )
			{
				// Refuse to take wild shots at targets far from reticle.
				if( GetActiveWeapon() != NULL && dot < GetActiveWeapon()->GetMaxAutoAimDeflection() )
				{
					// Be lenient if the player is looking down, though. 30 degrees through 90 degrees of pitch.
					// (90 degrees is looking down at player's own 'feet'. Looking straight ahead is 0 degrees pitch.
					// This was done for XBox to make it easier to fight headcrabs around the player's feet.
					if( eyeAngles.x < 30.0f || eyeAngles.x > 90.0f || g_pGameRules->GetAutoAimMode() != AUTOAIM_ON_CONSOLE )
					{
						continue;
					}
				}
			}

			score = GetAutoaimScore(vecSrc, v_forward, pEntity->GetAutoAimCenter(), pEntity, params.m_fScale, GetActiveWeapon() );

			if( score <= bestscore )
			{
				continue;
			}

			UTIL_TraceLine( vecSrc, center, MASK_SHOT, &traceFilter, &tr );

			if (tr.fraction != 1.0 && tr.m_pEnt != pEntity )
			{
				// Msg( "hit %s, can't see %s\n", STRING( tr.u.ent->classname ), STRING( pEdict->classname ) );
				continue;
			}

			// This is the best candidate so far.
			bestscore = score;
			bestent = pEntity;
			bestdir = dir;
		}
		if ( bestent )
		{
			QAngle bestang;

			VectorAngles( bestdir, bestang );

			if( IsInAVehicle() )
			{
				bestang -= EyeAngles();
			}
			else
			{
				bestang -= EyeAngles() - m_Local.m_vecPunchAngle;
			}

			m_fOnTarget = true;

			// Autoaim detected a target for us. Aim automatically at its bodytarget.
			params.m_hAutoAimEntity.Set(bestent);
			params.m_vecAutoAimDir = bestdir;
			params.m_vecAutoAimPoint = bestent->BodyTarget( vecSrc, false );
			params.m_bAutoAimAssisting = true;

			return bestang;
		}
	}

	return vec3_angle;
}
(c) https://github.com/ValveSoftware/sou...ver/player.cpp

I am still getting server crashes due to these two functions...

Code:
server_srv.so CBasePlayer::AutoaimDeflection(Vector &,autoaim_params_t &) -> 0x774f26
server_srv.so CBasePlayer::GetAutoaimVector(autoaim_params_t &) -> 0x775555
This is the code where the crash occurs:
Code:
int __cdecl CBasePlayer::GetAutoaimVector(int a1, int a2)
{
[...]
  if ( !(*(unsigned __int8 (__cdecl **)(int))(*(_DWORD *)a1 + 1808))(a1) || *(float *)(a2 + 28) == 0.0 )
  {
    v3 = (float *)(*(int (__cdecl **)(int))(*(_DWORD *)a1 + 568))(a1);
    v12 = *(float *)(a1 + 6864) + *v3;
    v13 = *(float *)(a1 + 6868) + v3[1];
    v14 = *(float *)(a1 + 6872) + v3[2];
    AngleVectors(&v12, &v9);
LABEL_3:
    *(_DWORD *)a2 = v9;
    *(_DWORD *)(a2 + 4) = v10;
    result = v11;
    *(_DWORD *)(a2 + 8) = v11;
    return result; /*********************** FAULT POINTER 0x775555 ***********************/
  }
[...]
  v5 = *(_DWORD *)(a2 + 24);
  if ( v5 == -1
    || (v6 = (char *)g_pEntityList + 16 * (*(_DWORD *)(a2 + 24) & 0xFFF), *((_DWORD *)v6 + 2) != v5 >> 12)
    || (result = *((_DWORD *)v6 + 1)) == 0 )
  {
    v7 = (float *)(*(int (__fastcall **)(void *))(*(_DWORD *)a1 + 568))(g_pEntityList);
    v17 = *(float *)(a1 + 6864) + *v7;
    v18 = *(float *)(a1 + 6868) + v7[1];
    v19 = *(float *)(a1 + 6872) + v7[2];
    AngleVectors(&v17, &v9);
    goto LABEL_3;
  }
  return result;
}
They are associated with a weapon shot (FireBullets looking the stack). but I have nothing on the server related to shots. I ask for help.
__________________

Last edited by Accelerator; 09-28-2020 at 04:33.
Accelerator is offline
Eneier
New Member
Join Date: Apr 2018
Old 09-28-2020 , 04:24   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#173

Quote:
Originally Posted by NiTro1 View Post
Just put that Cvar in Server.cfg without the quotes :

sv_quota_stringcmdspersecond "999999"
thank u. all works.
Eneier is offline
Sev
Veteran Member
Join Date: May 2010
Old 09-28-2020 , 13:39   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#174

I'm impressed with how quickly most of the stuff is working so soon.

I thought for sure with the long layoff between content for the game and the at times random animosity between server owners, coders and server owners/coders. That this game might be sunk by such a major update, but it seems most of the stuff has been put back together and really the only things that really remain are trying to fix whatever the community led update has broken that they likely won't fix like the rescue vehicle bug with more than 4 players or building on what was added in the update.

So that's good a sign.
Sev is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 09-28-2020 , 15:45   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#175

Quote:
Originally Posted by tRololo312312 View Post
BAD NEWS.

They made "cl_downloadfilter" default to "none" now. Meaning if you have any downloads on your server, you wont get any players to download them.
I just completely re-downloaded the client, and config.cfg still contains

Quote:
cl_downloadfilter "all"
regardless of:

Quote:
] cl_downloadfilter
"cl_downloadfilter" = "all" ( def. "none" )
archive
- Determines which files can be downloaded from the server (all, none, nosounds)
I just hoping valve doesn't update this change in cfg-file as well in future..., otherwise it will be a disaster for heavily modded servers community.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
myljach
Member
Join Date: Jul 2016
Location: Croatia
Old 09-28-2020 , 17:55   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#176

Quote:
Originally Posted by myljach View Post
Hello!

My 2 Coop servers after update works fine, all with around 80 plugins, and 170 custom maps(i test only few). Only 1 plugin is not work in my versus server, because is old, and newer SM 1.10.0.6461 not support it. So anione may recommend similar plugin? Is l4d2scores.smx --- https://forums.alliedmods.net/showthread.php?t=113188

Thanks in advance,
M.
Update,

i solve that issue by deleting Left4downtown, migrate to Dhoks and L4d2hooks, and download last version l4d2scores.smx that work with L4d2hooks by Silvers, thanks all for help and suggestions!
myljach is offline
tRololo312312
Senior Member
Join Date: Apr 2015
Old 09-28-2020 , 18:35   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#177

Quote:
Originally Posted by Dragokas View Post
I just completely re-downloaded the client, and config.cfg still contains cl_downloadfilter "all"
Do you have steam cloud enabled?
tRololo312312 is offline
tRololo312312
Senior Member
Join Date: Apr 2015
Old 09-28-2020 , 20:08   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#178

the updated signature for "CBaseAnimating::LookupSequence" makes the plugin load but now server crashes after few seconds of joining.
tRololo312312 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 09-28-2020 , 20:25   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#179

Quote:
Originally Posted by tRololo312312 View Post
the updated signature for "CBaseAnimating::LookupSequence" makes the plugin load but now server crashes after few seconds of joining.
Code:
 			"CBaseAnimating::LookupSequence"
			{
				"library"	"server"
				"mac"		"@_ZN14CBaseAnimating14LookupSequenceEPKc"
				"linux"		"@_ZN14CBaseAnimating14LookupSequenceEPKc"
				"windows"	"\x55\x8B\x2A\x56\x8B\x2A\x83\x2A\x2A\x2A\x2A\x2A\x2A\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\x2A\x74\x2A\x8B\x2A\xE8\x2A\xF6"
				/* 55 8B ? 56 8B ? 83 ? ? ? ? ? ? 75 ? E8 ? ? ? ? 85 ? 74 ? 8B ? E8 ? F6 */
			}
Try this one. Looks like I had wrong one before.
__________________
Silvers is offline
tRololo312312
Senior Member
Join Date: Apr 2015
Old 09-28-2020 , 20:40   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#180

Yep, that one works. Cheers!
tRololo312312 is offline
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode