* Remove the Unit from the game, doing all required administration for it, like * deselecting it, remove it from the radar count, stopping scripts, .. * * @param u The Unit to remove. */
| 895 | * @param u The Unit to remove. |
| 896 | */ |
| 897 | void Unit_Remove(Unit *u) |
| 898 | { |
| 899 | if (u == NULL) return; |
| 900 | |
| 901 | u->o.flags.s.allocated = true; |
| 902 | Unit_UntargetMe(u); |
| 903 | |
| 904 | if (u == g_unitSelected) Unit_Select(NULL); |
| 905 | |
| 906 | u->o.flags.s.bulletIsBig = true; |
| 907 | Unit_UpdateMap(0, u); |
| 908 | |
| 909 | Unit_HouseUnitCount_Remove(u); |
| 910 | |
| 911 | Script_Reset(&u->o.script, g_scriptUnit); |
| 912 | |
| 913 | Unit_Free(u); |
| 914 | } |
| 915 | |
| 916 | /** |
| 917 | * Gets the best target unit for the given unit. |
no test coverage detected