1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-02 22:14:37 +00:00

Cleanup underwater checks, fix rectangular water bubbles

Long/thin rectangular nodes were not handled correctly,
because it would only check the nearest waterbubble node
for overlap, not all on the map.

+ Lua func: isUnderWater(x, y, radius)
This commit is contained in:
fgenesis 2023-06-23 15:05:05 +02:00
parent 5e75bc486c
commit aaed341569
9 changed files with 71 additions and 50 deletions

View file

@ -59,7 +59,7 @@ public:
*x = x1 + ((*w) / 2);
*y = y1 + ((*h) / 2);
}
bool isCoordinateInside(const Vector &vec, int radius=0) const
bool isCoordinateInside(const Vector &vec, float radius=0) const
{
return ((vec.x >= x1-radius && vec.x <= x2+radius) && (vec.y >= y1-radius && vec.y <= y2+radius));
}