There is a bug in your linter that causes it to not recognize that the designated block can fail the if statement and skip the return statement:
-
The incorrect warning is:
“WARNING on line 75 (no-else-return)
Unnecessary 'else' after 'if'/'elif' blocks that end with 'return'”
-
The code that triggered this error is:
...
#Return false if vector_angle falls between start_arc and end_arc.
#This will ensure that weapons can only fire within their designated arcs.
if end_arc > start_arc:
if vector_angle > end_arc or vector_angle < start_arc:
return false
else:
if vector_angle > end_arc and vector_angle < start_arc:
return false
#Ensure target is within range
if vector_to_target.length() > ability_range:
return false
else:
return true
There is a bug in your linter that causes it to not recognize that the designated block can fail the if statement and skip the return statement:
The incorrect warning is:
“WARNING on line 75 (no-else-return)
Unnecessary 'else' after 'if'/'elif' blocks that end with 'return'”
The code that triggered this error is:
...
#Return false if vector_angle falls between start_arc and end_arc.
#This will ensure that weapons can only fire within their designated arcs.
if end_arc > start_arc:
if vector_angle > end_arc or vector_angle < start_arc:
return false
else:
if vector_angle > end_arc and vector_angle < start_arc:
return false
#Ensure target is within range
if vector_to_target.length() > ability_range:
return false
else:
return true