Fix being able to push boulders through walls 406/head
authorMario <mario@smbclan.net>
Tue, 24 Jan 2017 14:40:17 +0000 (00:40 +1000)
committerMario <mario@smbclan.net>
Tue, 24 Jan 2017 14:40:17 +0000 (00:40 +1000)
qcsrc/common/minigames/minigame/bd.qc

index d4e1eeb..904b777 100644 (file)
@@ -289,11 +289,26 @@ bool bd_move_dozer(entity minigame, entity dozer)
                        ty += dir.y;
 
                        testpos = minigame_tile_buildname(tx, ty);
+                       if(!bd_valid_tile(testpos))
+                               return false;
                        entity testhit = bd_find_piece(minigame, testpos, false);
-
-                       if(!bd_valid_tile(testpos) || testhit)
+                       if(testhit)
                                return false;
 
+                       entity controller = bd_find_controller(minigame, minigame_tile_letter(testpos));
+                       int tnum = minigame_tile_number(testpos);
+                       switch(controller.bd_tiletypes[tnum])
+                       {
+                               case BD_TILE_BRICK8:
+                               case BD_TILE_BRICK7:
+                               case BD_TILE_BRICK6:
+                               case BD_TILE_BRICK5:
+                               case BD_TILE_BRICK4:
+                               case BD_TILE_BRICK3:
+                               case BD_TILE_BRICK2:
+                               case BD_TILE_BRICK1: return false;
+                       }
+
                        if(hit.netname) { strunzone(hit.netname); }
                        hit.netname = strzone(testpos);
                        minigame_server_sendflags(hit,MINIG_SF_UPDATE);