Solved How to add on and off to this? After production, only turning on has an effect, and turning it off has no effect.

Status
Not open for further replies.

DigitalKnight

Approved Modder
Approved Modder
Jul 31, 2018
185
11,157
1,193
23
Within the Heart
Not sure i understand your question, the switch in this case would be your toggle button or anything else that passes a boolean value
 

OnePlus

Awesome Active Platinian
Original poster
Jan 30, 2019
170
11
18
29
山东省潍坊市
switch (featNum) {
case 0:
hack = boolean;
if (hack!= 0){
PATCH_LIB_SWITCH("libil2cpp.so", "03F9968", "00 01 A0 E3 1E FF 2F E1", boolean);
}
break;
}
}
}



It is written like this. After opening, closing has no effect. Is there something wrong?
 

DigitalKnight

Approved Modder
Approved Modder
Jul 31, 2018
185
11,157
1,193
23
Within the Heart
Because the statement "hack != 0" makes no sense here.
1st, the case only runs when the corresponding button is turned on/off

Second, PATCH_LIB_SWITCH already handles the conditional patching itself. If the boolean is true, it will patch the offset. If it's false, it will restore the offset. In short, you do not need any additional if/else statements with it
 
Status
Not open for further replies.