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

Fix excessive punchangle when getting shield shot #919

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

dystopm
Copy link
Contributor

@dystopm dystopm commented Jan 7, 2024

Fixes #918 - it demonstrates how abrupt punchangle change was done when getting shot using tactical shield.

@@ -1449,7 +1449,11 @@ VectorRef CBaseEntity::__API_HOOK(FireBullets3)(VectorRef vecSrc, VectorRef vecD
pEntity->pev->punchangle.x = iCurrentDamage * RANDOM_FLOAT(-0.15, 0.15);
pEntity->pev->punchangle.z = iCurrentDamage * RANDOM_FLOAT(-0.15, 0.15);

#ifndef REGAMEDLL_FIXES
Copy link
Member

@SergeyShorokhov SergeyShorokhov Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#ifndef REGAMEDLL_FIXES
#ifdef REGAMEDLL_FIXES
pEntity->pev->punchangle.x = clamp(pEntity->pev->punchangle.x, -4, 4)
pEntity->pev->punchangle.z = clamp(pEntity->pev->punchangle.x, -5, 5)
#else
if (pEntity->pev->punchangle.x < 4)
pEntity->pev->punchangle.x = -4;
if (pEntity->pev->punchangle.z < -5)
pEntity->pev->punchangle.z = -5;
else if (pEntity->pev->punchangle.z > 5)
pEntity->pev->punchangle.z = 5;
#endif

Copy link
Member

@SergeyShorokhov SergeyShorokhov Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks more logical that way, but I can't be sure of this solution.

:D
image

@s1lentq s1lentq merged commit fb9eb0d into rehlds:master Jan 31, 2024
4 checks passed
aleeperezz16 added a commit to Nostalgia-Gamers/ReGameDLL_CS that referenced this pull request Feb 14, 2024
commit d48fd3e
Merge: 5268e6b 5d2174f
Author: Alejo <[email protected]>
Date:   Wed Feb 14 19:17:25 2024 -0300

    Merge remote-tracking branch 'upstream/master'

commit 5d2174f
Author: s1lentq <[email protected]>
Date:   Mon Feb 5 02:21:49 2024 +0700

    CWeaponBox::Touch: Reworked dropped grenade pickup

commit 4d90a5f
Author: s1lentq <[email protected]>
Date:   Thu Feb 1 18:20:11 2024 +0700

    CWeaponBox::Touch: Fix grenade pickup (Resolves rehlds#923, Closes rehlds#931)

commit f4c4e89
Author: s1lentq <[email protected]>
Date:   Thu Feb 1 16:38:16 2024 +0700

    CBasePlayerWeapon::ExtractAmmo: Fixed reverse-engineering mistake

commit 2489213
Author: s1lentq <[email protected]>
Date:   Thu Feb 1 12:21:23 2024 +0700

    Resetable g_weaponSlotInfo

commit fb9eb0d
Author: Francisco Muñoz <[email protected]>
Date:   Wed Jan 31 09:38:35 2024 -0300

    Fix excessive punchangle when getting shield shot (rehlds#919)

commit 0bc4ff1
Author: Rafflesian <[email protected]>
Date:   Wed Jan 31 09:35:26 2024 -0300

    Support for secondary ammo and extra EF_ flags (rehlds#934)

    Support for secondary ammo and extra EF_ flags

commit 5287f2a
Author: s1lentq <[email protected]>
Date:   Wed Jan 31 19:16:37 2024 +0700

    Do not reduce points for bot suicide due bot_kill command

commit 0bbc4bd
Author: s1lentq <[email protected]>
Date:   Wed Jan 31 18:38:47 2024 +0700

    Do not reduce points for suicide due to a fatal fall

commit aec3ba2
Author: s1lentq <[email protected]>
Date:   Wed Jan 31 18:33:34 2024 +0700

    Fixed m_looseBombArea assertion

commit b34d564
Author: s1lentq <[email protected]>
Date:   Wed Jan 31 17:52:38 2024 +0700

    PM_CheckWater: Fix for uninitialized waterlevel value for dead players (incorrect waterlevel values from another player movements persisting)

commit a1af7ca
Author: s1lentq <[email protected]>
Date:   Wed Jan 31 17:40:47 2024 +0700

    CBasePlayer::WaterMove: No water sound playback occurs when clients emerge from network lag or was using noclip

commit bde6aa0
Author: s1lentq <[email protected]>
Date:   Wed Jan 31 15:51:44 2024 +0700

    Disable door asserts (Resolves rehlds#926)

commit 2d957a7
Author: s1lentq <[email protected]>
Date:   Wed Jan 31 15:10:08 2024 +0700

    utlvector.h fix assert

commit 4b49f63
Author: s1lentq <[email protected]>
Date:   Fri Jan 19 20:33:01 2024 +0700

    Fix mismatched damage glock18 in burst mode 18 against 25 (GLOCK18_DAMAGE)

commit 051dc07
Author: Sergey Shorokhov <[email protected]>
Date:   Fri Jan 12 11:55:00 2024 +0300

    New ConVar: `mp_defuser_allocation` (rehlds#908)

commit 89dda43
Author: s1lentq <[email protected]>
Date:   Fri Jan 12 13:30:01 2024 +0700

    fix test demo

commit 02a0516
Author: s1lentq <[email protected]>
Date:   Fri Jan 12 13:19:01 2024 +0700

    Reset damage stats on Putin Server

commit c0f4794
Author: s1lentq <[email protected]>
Date:   Fri Jan 12 09:27:40 2024 +0700

    PM_CategorizePosition: Do not stick to the ground of an OBSERVER or NOCLIP mode

commit e636cbc
Author: s1lentq <[email protected]>
Date:   Fri Jan 12 09:16:20 2024 +0700

    PlayerRelationship: GR_TEAMMATE on checking itself

commit 5268e6b
Merge: 9f54246 15df1a9
Author: Alejo <[email protected]>
Date:   Tue Jan 2 12:55:47 2024 -0300

    Merge branch 's1lentq:master' into master
@dystopm dystopm deleted the shield-punchangle-fix branch August 13, 2024 01:28
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

Successfully merging this pull request may close these issues.

FireBullets3. punchangle for SHIELD
3 participants