#include "Mobs.h"
#include "Client.h"

auto Hooks::Mobs::callback_getcurrentswingduration(Mob* _this) -> int {
	int duration = mob_getcurrentswingduration(_this);
	if (_this == Client::clientinstance->getLocalPlayer()) {
		for (Mod* mod : Client::modlist) {
			if (!mod->enabled && mod->onlyenabled) continue;

			mod->onSwingDuration(&duration);
		}

		if (Client::swingspeed != -1) {
			return Client::swingspeed;
		}
	}

	return duration;
}
