Hello everyone, i'm searching how to make my toggle works, here is my code:
OBFUSCATE("Category_小窍门 ◈ NO SKILL COOLDOWN"), //NOT COUNTED
OBFUSCATE("Toggle_(っ◔◡◔)っ ♥ Activate ♥"), //3 Case
my hook works, but i can't switch on / off, and i don't know why, maybe someone can help me on this ?
Thanks in advance!
nowhere
OBFUSCATE("Category_小窍门 ◈ NO SKILL COOLDOWN"), //NOT COUNTED
OBFUSCATE("Toggle_(っ◔◡◔)っ ♥ Activate ♥"), //3 Case
Code:
bool mCoolTime = false;
//the void *instance is a self-created variable.
void(*old_UseSkill_Update)(void *instance);
void UseSkill_Update(void *instance) {
//Check if instance is NULL to prevent CRASH
if (instance != NULL && mCoolTime) {
*(float *) ((uint64_t) instance + 0x80) = 0;
}
else
{
//return the original value (this code isn't really needed if you have a toggle/switch)
old_UseSkill_Update(instance);
}
}
MSHookFunction((void *) getAbsoluteAddress(targetLibName,
string2Offset(OBFUSCATE_KEY("0xe147e4", '?'))),
(void *)UseSkill_Update, (void **) &old_UseSkill_Update);
case 3:
mCoolTime = boolean;
break;
my hook works, but i can't switch on / off, and i don't know why, maybe someone can help me on this ?
Thanks in advance!