| 142 | } |
| 143 | |
| 144 | void UnitImpl::die() |
| 145 | { |
| 146 | index = 0xFFFF; |
| 147 | userSelected = false; |
| 148 | isAlive = false; |
| 149 | wasAlive = false; |
| 150 | wasCompleted = false; |
| 151 | wasAccessible = false; |
| 152 | wasVisible = false; |
| 153 | nukeDetected = false; |
| 154 | lastType = UnitTypes::Unknown; |
| 155 | lastPlayer = nullptr; |
| 156 | this->clientInfo.clear(); |
| 157 | this->interfaceEvents.clear(); |
| 158 | |
| 159 | updateInternalData(); |
| 160 | |
| 161 | //set pointers to null so we don't read information from unit table anymore |
| 162 | getOriginalRawData = nullptr; |
| 163 | |
| 164 | updateData(); |
| 165 | } |
| 166 | |
| 167 | /* canAccess returns true if the AI module is allowed to access the unit. |
| 168 | If the unit is visible, returns true. |