Fix various warnings that had piled up
This commit is contained in:
parent
8e6faddd2f
commit
452b553350
@ -1447,7 +1447,7 @@ static int LuaBlockMap(lua_State *L, ItemType minValue, ItemType maxValue, Acces
|
||||
template<class Accessor, class ItemType = typename LuaBlockMapHelper<Accessor>::ItemType>
|
||||
static int LuaBlockMap(lua_State *L, Accessor accessor)
|
||||
{
|
||||
return LuaBlockMapImpl<false>(L, 0, 0, accessor);
|
||||
return LuaBlockMapImpl<false>(L, ItemType(0), ItemType(0), accessor);
|
||||
}
|
||||
|
||||
static int sim_velocityX(lua_State *L)
|
||||
|
@ -85,7 +85,7 @@ static void initDeltaPos()
|
||||
{
|
||||
ui::Point d(rx, ry);
|
||||
if (std::abs(d.X) + std::abs(d.Y) <= maxLength)
|
||||
deltaPos.push_back(ETRD_deltaWithLength(d, std::hypot(d.X, d.Y)));
|
||||
deltaPos.push_back(ETRD_deltaWithLength(d, int(std::hypot(d.X, d.Y))));
|
||||
}
|
||||
std::stable_sort(deltaPos.begin(), deltaPos.end(), [](const ETRD_deltaWithLength &a, const ETRD_deltaWithLength &b) {
|
||||
return a.length < b.length;
|
||||
@ -103,7 +103,7 @@ int Element_ETRD_nearestSparkablePart(Simulation *sim, int targetId)
|
||||
if (parts[targetId].tmp2 && parts[targetId].tmp > parts[targetId].tmp2) // Invalid range if max is set
|
||||
return -1;
|
||||
|
||||
const int maxDistance = std::hypot(XRES, YRES);
|
||||
const int maxDistance = int(std::hypot(XRES, YRES));
|
||||
int foundDistance = parts[targetId].tmp2 ? std::min(parts[targetId].tmp2, maxDistance) : maxDistance; // tmp2 sets max distance
|
||||
int foundI = -1;
|
||||
ui::Point targetPos = ui::Point(int(parts[targetId].x), int(parts[targetId].y));
|
||||
@ -150,7 +150,7 @@ int Element_ETRD_nearestSparkablePart(Simulation *sim, int targetId)
|
||||
if (parts[i].type == PT_ETRD && !parts[i].life)
|
||||
{
|
||||
ui::Point checkPos = ui::Point(int(parts[i].x)-targetPos.X, int(parts[i].y)-targetPos.Y);
|
||||
int checkDistance = std::hypot(checkPos.X, checkPos.Y);
|
||||
int checkDistance = int(std::hypot(checkPos.X, checkPos.Y));
|
||||
if (checkDistance < foundDistance && checkDistance > parts[targetId].tmp && i != targetId) // tmp sets min distance
|
||||
{
|
||||
foundDistance = checkDistance;
|
||||
@ -170,7 +170,7 @@ int Element_ETRD_nearestSparkablePart(Simulation *sim, int targetId)
|
||||
{
|
||||
countLife0++;
|
||||
ui::Point checkPos = ui::Point(int(parts[i].x)-targetPos.X, int(parts[i].y)-targetPos.Y);
|
||||
int checkDistance = std::hypot(checkPos.X, checkPos.Y);
|
||||
int checkDistance = int(std::hypot(checkPos.X, checkPos.Y));
|
||||
if (checkDistance < foundDistance && checkDistance > parts[targetId].tmp && i != targetId) // tmp sets min distance
|
||||
{
|
||||
foundDistance = checkDistance;
|
||||
|
Loading…
Reference in New Issue
Block a user