-
Notifications
You must be signed in to change notification settings - Fork 12
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
trace_flags #29
Comments
Added, thanks for tip Ps. This cam be a fix for flash bug in ReGameDLL_CS: ?? |
It worked, but it causes problems when using: https://github.com/alliedmodders/amxmodx/blob/master/plugins/cstrike/statsx.sma#L172 register_event("StatusValue", "eventShowRank", "bd", "1=2") Sometimes he ignores his teammate and directly shows his opponent's name, but now when he shoots a teammate he deals damage with all weapons About flash bang, maybe it was necessary to do something like this? I don't know if that would solve it: void RadiusFlash_TraceLine_hook(CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAttacker, Vector &vecSrc, Vector &vecSpot, TraceResult *tr)
{
#ifdef REGAMEDLL_ADD
gpGlobals->trace_flags = FTRACE_FLASH;
#endif
UTIL_TraceLine(vecSrc, vecSpot, dont_ignore_monsters, ENT(pevInflictor), tr);
#ifdef REGAMEDLL_ADD
gpGlobals->trace_flags = 0;
#endif
} |
To fix friendly aim that maybe need to reset trace_flags to default after trace line? |
I tested this and it worked: if (gpGlobals->trace_flags & FTRACE_BULLET)
{
gpGlobals->trace_flags = FTRACE_BULLET;
g_engfuncs.pfnTraceLine(vStart, vEndRes, fNoMonsters, pentToSkip, ptr);
} Didn't work: if (gpGlobals->trace_flags & FTRACE_BULLET)
{
gpGlobals->trace_flags = FTRACE_BULLET;
}
g_engfuncs.pfnTraceLine(vStart, vEndRes, fNoMonsters, pentToSkip, ptr); Because ReGameDLL will set gpGlobals->trace_flags = FTRACE_BULLET automatically before calling the hook: https://github.com/s1lentq/ReGameDLL_CS/blob/master/regamedll/dlls/cbase.cpp#L1063 We need to make sure we are only changing the code when we perform a shot, we need to set gpGlobals->trace_flags = FTRACE_BULLET again and this may solve the flashbang problem if the problem comes from the module This part is not executed, so it can be removed gpGlobals->trace_flags = FTRACE_BULLET in: https://github.com/SmileYzn/AccuracyFix/blob/main/AccuracyFix/AccuracyUtil.cpp#L94 |
So you tell to trace line fix only when trace_flags = FTRACE_BULLET?
? |
Yes, I needed this check and everything worked correctly again, it would look like this: if (gpGlobals->trace_flags & FTRACE_BULLET)
{
gpGlobals->trace_flags = FTRACE_BULLET;
g_engfuncs.pfnTraceLine(vStart, vEndRes, fNoMonsters, pentToSkip, ptr);
} in: https://github.com/SmileYzn/AccuracyFix/blob/main/AccuracyFix/AccuracyFix.cpp#L101-L103 |
To be honest that if is needed to be in very first of of function |
I just tested it and everything works perfectly now, thank you very much |
🙏 |
@SmileYzn I installed a new action build plugin, but the shooting has become very unfair. Both bullets and spray are not working properly. Please fix it. |
The test fix is here: https://github.com/SmileYzn/AccuracyFix/actions/runs/10551207451 FTRACE_BULLET is not a bitwise! |
I apologize for my mistake. I just tested without: gpGlobals->trace_flags = FTRACE_BULLET; As it still has this value defined, then it is not necessary, just this check: (gpGlobals->trace_flags == FTRACE_BULLET) It turned out to be enough and at least for me everything is fine now |
So do not need to sign value to trace_flags? |
Yes it can be removed and if the inaccuracy continues it must be because you were updating the traceline the whole time, not just at the exact moment of the shot |
On my tests it fixed in all times, not only when shooting. Did fixed for you? Maybe fix only at things that is not ftrace_flash flag |
Yes, that solved it for me |
The long-range shooting with the pistol and assault rifle is still experiencing quite a few misses... |
I have removed that TRACE_BULLET check, it is only now for TRACE_FLASH |
thanks bro its fix and shotting love it :D |
@SmileYzn
Add FTRACE_BULLET to return compatibility with plugins that use this code:
s1lentq/ReGameDLL_CS#813
in:
https://github.com/SmileYzn/AccuracyFix/blob/main/AccuracyFix/AccuracyFix.cpp#L101
gpGlobals->trace_flags = FTRACE_BULLET; g_engfuncs.pfnTraceLine(vStart, vEndRes, fNoMonsters, pentToSkip, ptr);
I don't know if the same code could be added here as well:
https://github.com/SmileYzn/AccuracyFix/blob/main/AccuracyFix/AccuracyUtil.cpp#L94
gpGlobals->trace_flags = FTRACE_BULLET; g_engfuncs.pfnTraceLine(v_src, v_dest, 0, pEntity, &Result);
The text was updated successfully, but these errors were encountered: