Replaced every C-style cast with C++ ones

This commit is contained in:
Chase Cooper 2026-03-05 17:43:29 -05:00
parent 2d9768a1b8
commit d965a71464

View file

@ -224,8 +224,8 @@ void Boat::tick()
double yrd = Mth::wrapDegrees(lyr - yRot); double yrd = Mth::wrapDegrees(lyr - yRot);
yRot += (float) ( (yrd) / lSteps ); yRot += static_cast<float>((yrd) / lSteps);
xRot += (float) ( (lxr - xRot) / lSteps ); xRot += static_cast<float>((lxr - xRot) / lSteps);
lSteps--; lSteps--;
setPos(xt, yt, zt); setPos(xt, yt, zt);
@ -342,7 +342,7 @@ void Boat::tick()
double zDiff = zo - z; double zDiff = zo - z;
if (xDiff * xDiff + zDiff * zDiff > 0.001) if (xDiff * xDiff + zDiff * zDiff > 0.001)
{ {
yRotT = (float) (atan2(zDiff, xDiff) * 180 / PI); yRotT = static_cast<float>(atan2(zDiff, xDiff) * 180 / PI);
} }
double rotDiff = Mth::wrapDegrees(yRotT - yRot); double rotDiff = Mth::wrapDegrees(yRotT - yRot);
@ -350,7 +350,7 @@ void Boat::tick()
if (rotDiff > 20) rotDiff = 20; if (rotDiff > 20) rotDiff = 20;
if (rotDiff < -20) rotDiff = -20; if (rotDiff < -20) rotDiff = -20;
yRot += (float) rotDiff; yRot += static_cast<float>(rotDiff);
setRot(yRot, xRot); setRot(yRot, xRot);
// Server only code below // Server only code below