void (*EndRound)(void *instance);
bool EndCurrentRound;
void (*old_ClassName_Update)(void *instance);
void ClassName_Update(void *instance) {
if(instance!=nullptr) {
if(EndCurrentRound) {
EndRound(instance);
EndCurrentRound=false; // because we only want to call the method once
}
}
old_ClassName_Update(instance);
}
HOOK("0xOFFSET", ClassName_Update, old_ClassName_Update); // Add offset of update method
EndRound = (void(*)(void*)) getAbsoluteAddress(targetLibName, 0xOFFSET); // Add offset of EndRound method
OBFUSCATE("XX_Button_END ROUND"), // XX = add number at start to link to case
case XX:
EndCurrentRound = !EndCurrentRound;
break;