| 419 | } |
| 420 | |
| 421 | void AnimExt::InvalidateParticleSystemPointers(ParticleSystemClass* pParticleSystem) |
| 422 | { |
| 423 | for (auto const& pAnim : AnimExt::AnimsWithAttachedParticles) |
| 424 | { |
| 425 | auto const pExt = AnimExt::ExtMap.Find(pAnim); |
| 426 | |
| 427 | if (!pExt) |
| 428 | continue; // Skip animation, chances are it is a null type anim in process of being removed. |
| 429 | |
| 430 | if (pExt->AttachedSystem == pParticleSystem) |
| 431 | { |
| 432 | pExt->AttachedSystem = nullptr; |
| 433 | |
| 434 | auto& vec = AnimExt::AnimsWithAttachedParticles; |
| 435 | vec.erase(std::remove(vec.begin(), vec.end(), pAnim), vec.end()); |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | // ============================= |
| 441 | // container |