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:
parent
5e75bc486c
commit
aaed341569
9 changed files with 71 additions and 50 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue