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

Method makeFire

MicropolisCore/src/MicropolisEngine/src/disasters.cpp:294–312  ·  view source on GitHub ↗

Start a fire at a random place, requested by user */

Source from the content-addressed store, hash-verified

292
293/** Start a fire at a random place, requested by user */
294void Micropolis::makeFire()
295{
296 short t, x, y, z;
297
298 for (t = 0; t < 40; t++) {
299 x = getRandom(WORLD_W - 1);
300 y = getRandom(WORLD_H - 1);
301 z = map[x][y];
302
303 if ((!(z & ZONEBIT)) && (z & BURNBIT)) {
304 z = z & LOMASK;
305 if ((z > 21) && (z < LASTZONE)) {
306 map[x][y] = randomFire();
307 sendMessage(MESSAGE_FIRE_REPORTED, x, y);
308 return;
309 }
310 }
311 }
312}
313
314
315/**

Callers 1

buttonFire_ClickMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected