MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Explosion_Start

Function Explosion_Start

src/explosion.c:282–313  ·  view source on GitHub ↗

* Start a Explosion on a tile. * @param explosionType Type of Explosion. * @param position The position to use for init. */

Source from the content-addressed store, hash-verified

280 * @param position The position to use for init.
281 */
282void Explosion_Start(uint16 explosionType, tile32 position)
283{
284 const ExplosionCommandStruct *commands;
285 uint16 packed;
286 uint8 i;
287
288 if (explosionType > EXPLOSION_SPICE_BLOOM_TREMOR) return;
289 commands = g_table_explosion[explosionType];
290
291 packed = Tile_PackTile(position);
292
293 Explosion_StopAtPosition(packed);
294
295 for (i = 0; i < EXPLOSION_MAX; i++) {
296 Explosion *e;
297
298 e = &g_explosions[i];
299
300 if (e->commands != NULL) continue;
301
302 e->commands = commands;
303 e->current = 0;
304 e->spriteID = 0;
305 e->position = position;
306 e->isDirty = false;
307 e->timeOut = g_timerGUI;
308 s_explosionTimer = 0;
309 g_map[packed].hasExplosion = true;
310
311 break;
312 }
313}
314
315/**
316 * Timer tick for explosions.

Callers 2

Map_MakeExplosionFunction · 0.85
Map_DeviateAreaFunction · 0.85

Calls 1

Explosion_StopAtPositionFunction · 0.85

Tested by

no test coverage detected