mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-12 08:21:02 +02:00
Stop boulders being pushed through walls (#754)
checkBoulderPush had an isWarpTileCell escape hatch that let a boulder be pushed onto any door/warp tile, walkable or not. In pokered, CheckForCollisionWhenPushingBoulder walks the same wTilesetCollisionPtr list as player movement (CheckTilePassable) -- there is no hole/warp exception, so a boulder can never land on a cell the player cannot walk onto. The known push targets (CAVERN holes, Victory Road switches) are walkable tiles in their tileset's coll list already, so removing the escape hatch only stops pushing boulders into walls. Fixes #754
This commit is contained in:
@@ -1216,12 +1216,16 @@ function OverworldState:checkBoulderPush(dir)
|
|||||||
end
|
end
|
||||||
local bx, by = Collision.target(fx, fy, dir)
|
local bx, by = Collision.target(fx, fy, dir)
|
||||||
if not self.map:inBounds(bx, by) then self.boulderTried = nil return false end
|
if not self.map:inBounds(bx, by) then self.boulderTried = nil return false end
|
||||||
|
-- CheckForCollisionWhenPushingBoulder uses the same walkable check as
|
||||||
|
-- player movement (CheckTilePassable walks the same wTilesetCollisionPtr
|
||||||
|
-- list) -- there is no hole/warp escape hatch in the original, so a
|
||||||
|
-- boulder can never be pushed onto a cell the player cannot walk onto.
|
||||||
|
-- The known push targets (CAVERN $22 holes, Victory Road switches) are
|
||||||
|
-- walkable tiles in their tileset's coll list already, so removing the
|
||||||
|
-- port's isWarpTileCell exception only stops wall pushes (#754).
|
||||||
if not self.map:isWalkableCell(bx, by) then
|
if not self.map:isWalkableCell(bx, by) then
|
||||||
-- boulders may be pushed into holes/switch spots that aren't walkable
|
self.boulderTried = nil
|
||||||
if not self.map:isWarpTileCell(bx, by) then
|
return false
|
||||||
self.boulderTried = nil
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
if Collision.occupied(self.entities, bx, by, npc) then
|
if Collision.occupied(self.entities, bx, by, npc) then
|
||||||
self.boulderTried = nil
|
self.boulderTried = nil
|
||||||
|
|||||||
Reference in New Issue
Block a user