![]() |
Arc hitbox system for weapons triggering three times per swing.
Alright, so I incorporated this thing maybe a few months ago, and while testing something, I realized that it was triggering three times every attack. Oddly enough, it doesn't deal damage three times, but it interferes with things that trigger every time onDamage() is triggered. Weapons that do not have "arc" in the data do not use this system and therefore do not cause this problem. After some testing, I've concluded that the problem definately lies in this script, and is not caused by the initial key input nor post-onDamage() portions of the system.
Any idea as to what could be causing the issue? PHP Code:
|
Whenever you hit a player, do this:
continue; this will tell the loop that you have accomplished what you needed to do in that loop instance(you hit the player, you no longer need to do the rest of the checks for the same player), and to go to the next loop. Also, there is more that goes into hit detection than the player detection. For instance, you are probably triggering it with a keypress, which could also be the culprit. |
You might also want to move some of that code to functions. I.e:
PHP Code:
PHP Code:
Your code can then be re-factored to: PHP Code:
|
All times are GMT +2. The time now is 01:18 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.