* Removes the Unit from the given packed tile. * * @param unit The Unit to remove. * @param packed The packed tile. */
| 2531 | * @param packed The packed tile. |
| 2532 | */ |
| 2533 | void Unit_RemoveFromTile(Unit *unit, uint16 packed) |
| 2534 | { |
| 2535 | Tile *t = &g_map[packed]; |
| 2536 | |
| 2537 | if (t->hasUnit && Unit_Get_ByPackedTile(packed) == unit && (packed != Tile_PackTile(unit->currentDestination) || unit->o.flags.s.bulletIsBig)) { |
| 2538 | t->index = 0; |
| 2539 | t->hasUnit = false; |
| 2540 | } |
| 2541 | |
| 2542 | Map_MarkTileDirty(packed); |
| 2543 | |
| 2544 | Map_Update(packed, 0, false); |
| 2545 | } |
| 2546 | |
| 2547 | void Unit_AddToTile(Unit *unit, uint16 packed) |
| 2548 | { |
no test coverage detected