#pragma once
#include "Mod.h"

class NoSlow : public Mod {
public:
	int mode = 0;
	NoSlow() : Mod(_("No Slow"), _("Keep your feet fast at all times."), Category::MOVEMENT) {

		{
			tickentity_itemuseslowdownmodifiercomponent_ = Utils::Memory::FindPattern(_("48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 40 49 8B F8 4D"));
			DWORD oldProtect;
			VirtualProtect((void*)tickentity_itemuseslowdownmodifiercomponent_, 5, PAGE_EXECUTE_READWRITE, &oldProtect);
			memcpy(ogBytes, (void*)tickentity_itemuseslowdownmodifiercomponent_, 5);
			VirtualProtect((void*)tickentity_itemuseslowdownmodifiercomponent_, 5, oldProtect, &oldProtect);
		}

		enabled = false;
	}

private:
	bool patched = false;
	void* tickentity_itemuseslowdownmodifiercomponent_;
	void* ogBytes[5] = { 0 };

	virtual auto onWorldTick(Player* _this) -> void override;
	virtual auto onDisabled() -> void override;
	virtual auto getMode() -> std::string override;
};
