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

Method setFire

MicropolisCore/src/MicropolisEngine/src/disasters.cpp:275–290  ·  view source on GitHub ↗

Start a fire at a random place, random disaster or scenario */

Source from the content-addressed store, hash-verified

273
274/** Start a fire at a random place, random disaster or scenario */
275void Micropolis::setFire()
276{
277 short x, y, z;
278
279 x = getRandom(WORLD_W - 1);
280 y = getRandom(WORLD_H - 1);
281 z = map[x][y];
282
283 if ((z & ZONEBIT) == 0) {
284 z = z & LOMASK;
285 if (z > LHTHR && z < LASTZONE) {
286 map[x][y] = randomFire();
287 sendMessage(MESSAGE_FIRE_REPORTED, x, y, true);
288 }
289 }
290}
291
292
293/** Start a fire at a random place, requested by user */

Callers 2

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected