github PR #868 - fix replacement of 'w' terrain

Pull request from copperwater:  terrain replacement couldn't match
'w' because it only checked actual terrain types.

Fixes #868
This commit is contained in:
PatR
2022-09-22 23:56:31 -07:00

View File

@@ -5564,7 +5564,9 @@ lspo_replace_terrain(lua_State *L)
if (mapfrag_match(mf, x, y) && (rn2(100)) < chance)
(void) set_levltyp_lit(x, y, totyp, tolit);
} else {
if (levl[x][y].typ == fromtyp && rn2(100) < chance)
if (((fromtyp == MATCH_WALL && IS_STWALL(levl[x][y].typ))
|| levl[x][y].typ == fromtyp)
&& rn2(100) < chance)
(void) set_levltyp_lit(x, y, totyp, tolit);
}
}