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

Function Script_Structure_Explode

src/script/structure.c:557–579  ·  view source on GitHub ↗

* Make the structure explode. * * Stack: *none* * * @param script The script engine to operate on. * @return unknown. */

Source from the content-addressed store, hash-verified

555 * @return unknown.
556 */
557uint16 Script_Structure_Explode(ScriptEngine *script)
558{
559 Structure *s;
560 uint16 position;
561 uint16 layout;
562 uint16 i;
563
564 VARIABLE_NOT_USED(script);
565
566 s = g_scriptCurrentStructure;
567 layout = g_table_structureInfo[s->o.type].layout;
568 position = Tile_PackTile(s->o.position);
569
570 for (i = 0; i < g_table_structure_layoutTileCount[layout]; i++) {
571 tile32 tile;
572
573 tile = Tile_UnpackTile(position + g_table_structure_layoutTiles[layout][i]);
574
575 Map_MakeExplosion(EXPLOSION_STRUCTURE, tile, 0, 0);
576 }
577
578 return 0;
579}
580
581/**
582 * Destroy a structure and spawn soldiers around the place.

Callers

nothing calls this directly

Calls 2

Tile_UnpackTileFunction · 0.85
Map_MakeExplosionFunction · 0.85

Tested by

no test coverage detected