Think you can do it like this, however this is just a theory so might not work correctly

But I think you can do it by adding two checks.

first you need to know the angle of the chassis, as its based on its angle to determine the limits of the turret.

You need to calculate both limits. will call these High limit and low limit. Which simply means that high limit is the clockwise limit, and the low limit the counter clockwise limit.

To calculate the high limit.

Chassis.angle + 130 (Turret limit)This number you need to check if is more than 360.

Chassis.angle + 130 > 360If that's the case you know that it have passed the 360 marker and will start to go from 0 and up.

So to calculate that one, you have to do the following,

(Chassis.angle + 130) - 360That will give you the high limit, if Chassis.angle + 130 is more than 360.

Its pretty much the same for the lower limit.

Chassis.angle - 130 < 0To calculate the lower limit if it passes 0 angle marker.

(Chassis.angle - 130) + 360 Will give you the lower limit.

Example using real numbers:Chassis is moving upwards at an angle of 245 and the turret is just following along at the same angle.

Lets assume that an enemy shows up at angle 60 (Somewhere behind the tank)

So to see if the turret can actually hit it, we calculate the two limits.

High limit (Chassis.angle + 130 > 360)

245 + 130 > 360 = 375Since that pass the marker we calculate the following:

375 - 360 = 15 High limit angle Low limit (Chassis.angle - 130 < 0)

245 - 130 < 0 = 115Since this doesn't pass the 0 angle marker we can use the calculated angle as the lower limit.

So the tank turret will be able to shoot at everything going from Low limit angle 115 to high limit angle of 15.

So in this case it wouldn't be able to attack the enemy.

Anyway its just a theory, I haven't actually tested if it works, but think it will