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

Function Map_DeviateArea

src/map.c:642–662  ·  view source on GitHub ↗

* Make a deviator missile explosion on the given position, of a certain type. All units in the * given radius may become deviated. * @param type The type of explosion. * @param position The position of the explosion. * @param radius The radius. * @param houseID House controlling the deviator. */

Source from the content-addressed store, hash-verified

640 * @param houseID House controlling the deviator.
641 */
642void Map_DeviateArea(uint16 type, tile32 position, uint16 radius, uint8 houseID)
643{
644 PoolFindStruct find;
645
646 Explosion_Start(type, position);
647
648 find.type = 0xFFFF;
649 find.index = 0xFFFF;
650 find.houseID = HOUSE_INVALID;
651
652 while (true) {
653 Unit *u;
654
655 u = Unit_Find(&find);
656
657 if (u == NULL) break;
658 if (Tile_GetDistance(position, u->o.position) / 16 >= radius) continue;
659
660 Unit_Deviate(u, 0, houseID);
661 }
662}
663
664/**
665 * Perform a bloom explosion, filling the area with spice.

Callers 1

Unit_MoveFunction · 0.85

Calls 4

Explosion_StartFunction · 0.85
Unit_FindFunction · 0.85
Tile_GetDistanceFunction · 0.85
Unit_DeviateFunction · 0.85

Tested by

no test coverage detected