| 56 | } |
| 57 | |
| 58 | void ShieldClass::PointerGotInvalid(void* ptr, bool removed) |
| 59 | { |
| 60 | auto const abs = static_cast<AbstractClass*>(ptr); |
| 61 | |
| 62 | if (auto const pAnim = abstract_cast<AnimClass*, true>(abs)) |
| 63 | { |
| 64 | if (auto const pAnimExt = AnimExt::ExtMap.Find(pAnim)) |
| 65 | { |
| 66 | if (pAnimExt->IsShieldIdleAnim) |
| 67 | { |
| 68 | for (auto const pShield : ShieldClass::Array) |
| 69 | { |
| 70 | if (pAnim == pShield->IdleAnim) |
| 71 | { |
| 72 | pShield->IdleAnim = nullptr; |
| 73 | break; // one anim must be used by less than one shield |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | // ============================= |
| 82 | // load / save |