Jump to content

expected '(' for function-style cast or type construction syntax error


Tay-K 47

2 posts in this topic

Recommended Posts

Posted

hello, good evening. I keep getting this compile error when I try and compile my mod, 

Tweak.xm:25:62: error: expected '(' for function-style cast or type construction
ThirdPersonController_WalkSpeed(thirdPersonController, float value);

so like a normal person I took to google, I ended up finding that it was a c++ syntax error and I attempted their fixes.

the error remains. so I came here to get an experts help on what I messed up

here's the whole tweak xm code for what I've done.

#import "Macros.h"
#import <CoreFoundation/CoreFoundation.h>
#import <substrate.h>
#import <Foundation/Foundation.h>

//public void set_WalkSpeed(float value); // RVA: 0x18A5724 Offset: 0x18A5724 VA: 0x1018A5724
void(*set_WalkSpeed)(void *Update) = (void(*) (void *))getRealOffset(0x1018A607C);

    bool shouldactivateSuperSpeed = true;
    
void(*old_ThirdPersonController_Update)(void *thirdPersonController, float value);
void ThirdPersonController_Update(void *thirdPersonController, float value) {

int item = [[switches getValueFromSwitch:@"SuperSpeed:"]intValue];

if([switches isSwitchOn:@"SuperSpeed:"])

{

if(shouldactivateSuperSpeed)

{

ThirdPersonController_WalkSpeed(thirdPersonController, float value);

    shouldactivateSuperSpeed = false;
    
    }

}

else

{

    shouldactivateSuperSpeed = true;

    }
}

void setup() {

MSHookFunction((void *)getRealOffset(0x1018A607C), (void *)ThirdPersonController_Update, (void**)&ThirdPersonController_Update);
        
        [switches addTextfieldSwitch:@"SuperSpeed:"
            description:@"Here you can enter your own speed amount"
              inputBorderColor:UIColorFromHex(0xffffff)];
                
                
}

whoever sees this thank you and have a nice day.

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines