Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on give weapons or drop weapons #752

Open
skillersgamers opened this issue Apr 18, 2022 · 5 comments
Open

Crash on give weapons or drop weapons #752

skillersgamers opened this issue Apr 18, 2022 · 5 comments

Comments

@skillersgamers
Copy link

skillersgamers commented Apr 18, 2022

CBasePlayerWeapon *weapon = (CBasePlayerWeapon *)pPlayer->m_pActiveItem->GetWeaponPtr();

image

dump file https://anonfiles.com/V8R7E8Xdx6/hlds_3.11.0.0-dev-_crash_20220417_160121_1_mdmp

@RauliTop
Copy link
Contributor

RauliTop commented Apr 18, 2022

It is listed at ToDo many years ago (open in new tab)
https://github.com/s1lentq/ReGameDLL_CS/projects/1#card-7419041

Need to investigate the case and fix very strange crash on UpdateClientData with entity not item on m_pActiveItem or an entity died.
More detailed: http://aghl.ru/forum/viewtopic.php?f=10&t=2811

Added by @s1lentq

@skillersgamers
Copy link
Author

any way to avoid this? I get 5 crash per day minimum

@RauliTop
Copy link
Contributor

RauliTop commented Apr 21, 2022

any way to avoid this? I get 5 crash per day minimum

Do you have a plugin hooking FM_UpdateClientData ?
Probably problem is there.

@skillersgamers
Copy link
Author

any way to avoid this? I get 5 crash per day minimum

Do you have a plugin hooking FM_UpdateClientData ? Probably problem is there.

Hello,I disable the hook FM_UpdateClientData but the problem stills

You know another hooking to disable?

also i'm using this function to give items

ham_give_item(iPlrId, iClassName[]) // ham fowrad is useful, cause it doesn't emit no item sound
{
//	give_item(iPlrId, iClassName)
//	return PLUGIN_HANDLED;


	new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, iClassName));
	if( iEnt<=0 || !pev_valid(iEnt) )
		return 0;
	
	set_pev(iEnt, pev_spawnflags, SF_NORESPAWN);
	dllfunc(DLLFunc_Spawn, iEnt);
	
	if( ExecuteHamB(Ham_AddPlayerItem, iPlrId, iEnt) )
	{
		ExecuteHamB(Ham_Item_AttachToPlayer, iEnt, iPlrId);
		return iEnt;
	}
	
	if( pev_valid(iEnt) )
		set_pev(iEnt, pev_flags, (pev(iEnt, pev_flags)|FL_KILLME));
	
	return -1;
}

@RauliTop
Copy link
Contributor

Hello,I disable the hook FM_UpdateClientData but the problem stills

You know another hooking to disable?

also i'm using this function to give items

It seems everything fine there.

Do you have a plugin that changes m_pActiveItem offset?

jonathan-up added a commit to jonathan-up/ReGameDLL_CS that referenced this issue Aug 11, 2024
* Update workflows/build.yml
Fix temporarily testdemos

* Fix compiler warnings

* Fixed a bug in spectator move with no apply friction when stopped

* Update build.yml

* Add support IN_RUN key for +speed button in spectator/noclip and walk moves
Add cheat impulse for enable Noclip with air accelerate

* try fix a crash due to the deletion of an item in an unusual way
related rehlds#870, rehlds#752, rehlds#924, rehlds#957

* Extend KickBack functionalities (rehlds#980)

---------

Co-authored-by: s1lentq <s1lentsk@yandex.ru>
Co-authored-by: Francisco Muñoz <fjmunozpena@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants