diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas
index 7afc4ee0c50267988a295d9e199c456eeb5d75cc..c84ba47eda80a1e2c6097a134a78d5ba0929a212 100644 (file)
--- a/src/game/g_gfx.pas
+++ b/src/game/g_gfx.pas
State: Byte;
ParticleType: Byte;
offsetX, offsetY: ShortInt;
State: Byte;
ParticleType: Byte;
offsetX, offsetY: ShortInt;
+ // for bubbles
+ liquidTopY: Integer; // don't float higher than this
end;
TOnceAnim = record
end;
TOnceAnim = record
end;
end;
end;
end;
+
procedure g_GFX_Bubbles(fX, fY: Integer; Count: Word; DevX, DevY: Byte);
var
a: Integer;
DevX1, DevX2,
DevY1, DevY2: Byte;
procedure g_GFX_Bubbles(fX, fY: Integer; Count: Word; DevX, DevY: Byte);
var
a: Integer;
DevX1, DevX2,
DevY1, DevY2: Byte;
- l: Integer;
+ l, liquidx: Integer;
begin
l := Length(Particles);
if l = 0 then
begin
l := Length(Particles);
if l = 0 then
(Y >= gMapInfo.Height) or (Y <= 0) then
Continue;
(Y >= gMapInfo.Height) or (Y <= 0) then
Continue;
+ (*
+ // don't spawn bubbles outside of the liquid
if not isLiquidAt(X, Y) {ByteBool(gCollideMap[Y, X] and MARK_LIQUID)} then
Continue;
if not isLiquidAt(X, Y) {ByteBool(gCollideMap[Y, X] and MARK_LIQUID)} then
Continue;
+ *)
+
+ // trace liquid, so we'll know where it ends; do it in 8px steps for speed
+ // tracer will return `false` if we started outside of the liquid
+ if not g_Map_TraceLiquid(X, Y, 0, -8, liquidx, liquidTopY) then continue;
VelX := 0;
VelY := -1-Random;
VelX := 0;
VelY := -1-Random;