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

[PhaseFour] broken item chat spam #345

Closed
bugreporters opened this issue Aug 28, 2017 · 3 comments
Closed

[PhaseFour] broken item chat spam #345

bugreporters opened this issue Aug 28, 2017 · 3 comments
Assignees

Comments

@bugreporters
Copy link

@bugreporters bugreporters commented Aug 28, 2017

After firing any weapon until the point the durability reaches 0 it breaks. That works like it's intended, but what then happens is it floods the players chat and console with this:

[HTML] http://forums.cloudsixteen.com/js/xenforo/xenforo.js?_v=073095e7:170: Uncaught TypeError: Property 'group' of object # is not a function

This weapon is broken and needs to be repaired!
This weapon is broken and needs to be repaired!
This weapon is broken and needs to be repaired!

After switching off the weapon immediately stops this spam but the second you switch back to the weapon it starts back up. Even after holster / dropping then re-equipping the same thing happens.

Edit: I found out the HTML Message occurs every time you open the Tab Menu.

@xRJx

This comment has been minimized.

Copy link
Contributor

@xRJx xRJx commented Aug 22, 2018

This looks like an infinite loop issue. Here's the trace of functions being called:
PhaseFour:PlayerCanFireWeapon > Clockwork.kernel:HandleWeaponFireDelay > Clockwork.player:UpdateWeaponRaised > Clockwork:PlayerThink

So what ends up happening is that the code checking for durability is called every time the PlayerThink function is called. My suggestion is to move the durability code to a different callback, such as when the player explicitly tries to fire a weapon.

I'm not sure if this is possible, I'll look in to it.

@xRJx

This comment has been minimized.

Copy link
Contributor

@xRJx xRJx commented Aug 22, 2018

I've reproduced the bug.

@xRJx

This comment has been minimized.

Copy link
Contributor

@xRJx xRJx commented Aug 22, 2018

I've gotten this fixed. The fix has been committed to the private repository for Phase Four.

I had to do a sort of workaround by adding the NotifyBrokenWeapon command which gets executed when primary/secondary attack is pressed with the broken weapon equipped, it also gets executed when the weapon is wielded.

Fun fact: Clockwork.player:Notify can't be executed in clientside files, hence the workaround.

If anyone knows of a way to use Clockwork.player:Notify without having to use a command then feel free to let me know. :)

@xRJx xRJx closed this Aug 22, 2018
@xRJx xRJx self-assigned this Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.