Closed bugreporters closed 6 years ago
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.
I've reproduced the bug.
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. :)
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:
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.