The function I'm asking about should have been void so i changed it and fixed the issue. The bad code i had with return not working for and int function i haxed up and temporally fixed. I just put a few else if statements together to bypass the issue. Just trying to learn the correct way.
A function declared to return a value should always return a value.
In your case the code would be something like:
int Functionname(){
if(this == true){
return 0;
}
//code i dont want to execute if this is true
return 1;
}
The code calling the function can then test the returned value to see if this==true or not.
If you just want to exit the function if this==true and aren't going to test the value elsewhere declare the function as void instead of int and just return;