MCPcopy Create free account
hub / github.com/SimHacker/micropolis / destroyMapTile

Method destroyMapTile

MicropolisCore/src/MicropolisEngine/src/sprite.cpp:1709–1750  ·  view source on GitHub ↗

* Destroy a map tile. * @param ox X coordinate in pixels. * @param oy Y coordinate in pixels. */

Source from the content-addressed store, hash-verified

1707 * @param oy Y coordinate in pixels.
1708 */
1709void Micropolis::destroyMapTile(int ox, int oy)
1710{
1711 short t, z, x, y;
1712
1713 x = ox >>4;
1714 y = oy >>4;
1715
1716 if (!testBounds(x, y)) {
1717 return;
1718 }
1719
1720 z = map[x][y];
1721 t = z & LOMASK;
1722
1723 if (t >= TREEBASE) {
1724 if (!(z & BURNBIT)) {
1725
1726 if (t >= ROADBASE && t <= LASTROAD) {
1727 map[x][y] = RIVER;
1728 }
1729
1730 return;
1731 }
1732
1733 if (z & ZONEBIT) {
1734
1735 startFireInZone(x, y, z);
1736
1737 if (t > RZB) {
1738 makeExplosionAt(ox, oy);
1739 }
1740
1741 }
1742
1743 if (checkWet(t)) {
1744 map[x][y] = RIVER;
1745 } else {
1746 map[x][y] = (doAnimation ? TINYEXP : (LASTTINYEXP - 3))
1747 | BULLBIT | ANIMBIT;
1748 }
1749 }
1750}
1751
1752
1753/**

Callers

nothing calls this directly

Calls 2

testBoundsFunction · 0.85
checkWetFunction · 0.85

Tested by

no test coverage detected