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

Method startFire

MicropolisCore/src/MicropolisEngine/src/sprite.cpp:1800–1823  ·  view source on GitHub ↗

* Start a fire at a single tile. * @param x X coordinate in map coordinate. * @param y Y coordinate in map coordinate. */

Source from the content-addressed store, hash-verified

1798 * @param y Y coordinate in map coordinate.
1799 */
1800void Micropolis::startFire(int x, int y)
1801{
1802 int t, z;
1803
1804 x >>= 4;
1805 y >>= 4;
1806
1807 if (!testBounds(x, y)) {
1808 return;
1809 }
1810
1811 z = map[x][y];
1812 t = z & LOMASK;
1813
1814 if (!(z & BURNBIT) && t != DIRT) {
1815 return;
1816 }
1817
1818 if (z & ZONEBIT) {
1819 return;
1820 }
1821
1822 map[x][y] = randomFire();
1823}
1824
1825
1826/**

Callers

nothing calls this directly

Calls 1

testBoundsFunction · 0.85

Tested by

no test coverage detected