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

PlayerSwitchWeapon #2922

Open
mcNuggets1 opened this issue Nov 14, 2016 · 2 comments
Open

PlayerSwitchWeapon #2922

mcNuggets1 opened this issue Nov 14, 2016 · 2 comments

Comments

@mcNuggets1
Copy link

mcNuggets1 commented Nov 14, 2016

Details

When networking the newWeapon on the hook PlayerSwitchWeapon to the client, it can occur, when the hook only runs the serverside, the weapon does not get networked properly making the weapon nil.

That makes no proper hook for initializing stuff on weapons, besides on overriding hooks, like WEAPON:INITIALIZE.

Steps to reproduce

Run the hook.
Network weapon.

@Kefta
Copy link
Contributor

Kefta commented Nov 14, 2016

This is due to the weapon being seen late by the client. To my knowledge, this is core engine behaviour and can be worked-around by either waiting in a timer for the weapon to be valid, or initialize in the deploy method if the weapon has not done so yet (which is what I do in my base).

@mcNuggets1
Copy link
Author

Already tried with a 1 second timer.
That did not work, the weapon entity was still invalid.

I already said, overwriting is bad for me, atleast.

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