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

Vortigaunt attack causes closest player to drop object instead of victim #158

Open
ampreeT opened this issue Oct 19, 2024 · 2 comments
Open
Labels
entity-issues engine entity-related bugs/crashes/issues plugin-issues plugin-related bugs/crashes/issues

Comments

@ampreeT
Copy link
Owner

ampreeT commented Oct 19, 2024

Expected behavior is for the victim to drop their object instead of the closest player. We may need to rethink our approach for the hooked function UTIL_GetLocalPlayer as it is presumably causing this.

bms_RGF4zoOwez.mp4
@Alienmario
Copy link
Collaborator

Current pre-setter works as a fallback on best effort basis. In these instances ideally we catch the issue upstream and rework it with proper multiplayer support.

As for UTIL_GetLocalPlayer, we could add stacking support (for those functions that are too difficult to rewrite).
Turn g_pLocalPlayerEntity into a 32 element array (generous size for start imo), push on pre-hook, pop on post hook.
SetLocalPlayerEntity() already supports passing a player index directly.

@Alienmario
Copy link
Collaborator

Alienmario commented Oct 19, 2024

The main issue here is Hook_ForcePlayerToDropThisObject not being called, while it is on linux.

Edit : Pickup_ForcePlayerToDropThisObject is inlined inside BreakOrDropPlayerHeldItem on Windows for some reason.

Windows
BreakOrDropPlayerHeldItem
image
Pickup_ForcePlayerToDropThisObject
image

Linux
BreakOrDropPlayerHeldItem
image
Pickup_ForcePlayerToDropThisObject
image

Alienmario added a commit that referenced this issue Oct 24, 2024
Implements LocalPlayer + MaxClients override stacking first mentioned in #158 (comment) .
@Alienmario Alienmario added entity-issues engine entity-related bugs/crashes/issues plugin-issues plugin-related bugs/crashes/issues labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entity-issues engine entity-related bugs/crashes/issues plugin-issues plugin-related bugs/crashes/issues
Projects
None yet
Development

No branches or pull requests

2 participants