Allow to place theme objects on water
authorWuzzy <almikes@aol.com>
Thu, 06 Apr 2017 05:54:45 +0200
changeset 12168 666e18b1ca32
parent 12167 1ce6ee2525db
child 12169 869cf5f34700
Allow to place theme objects on water
ChangeLog.txt
hedgewars/uLandObjects.pas
--- a/ChangeLog.txt	Wed Apr 05 18:23:10 2017 +0200
+++ b/ChangeLog.txt	Thu Apr 06 05:54:45 2017 +0200
@@ -188,6 +188,7 @@
 
 Content Creation:
  + Theme objects can now have more than 1 in-land rect specified. You can specify the amount in theme.cfg by adding another number (and ,) before the first rect
+ + Theme objects can now be placed on water (by setting first in-land rectangle to 0,0,0,0)
  + Themes can now use flakes with negative falling speed (rising flakes)
  + Themes can now contain custom sound files: splash.ogg Droplet1.ogg Droplet2.ogg Droplet3.ogg skip.ogg
  + Themes can now have mirrored clouds and flakes: CloudsL.png, SDCloudsL.png, FlakeL.png, SDFlakeL.png
--- a/hedgewars/uLandObjects.pas	Wed Apr 05 18:23:10 2017 +0200
+++ b/hedgewars/uLandObjects.pas	Thu Apr 06 05:54:45 2017 +0200
@@ -396,6 +396,10 @@
     repeat
         y:= topY+32; // leave room for a hedgie to teleport in
         repeat
+
+            if (inland[1].x = 0) and (inland[1].y = 0) and (inland[1].w = 0) and (inland[1].h = 0) then
+                y := LAND_HEIGHT - Height;
+
             if CheckCanPlace(x, y, Obj) then
                 begin
                 ar[cnt].x:= x;