| 4821 | } |
| 4822 | |
| 4823 | void wzapi::processScriptQueuedObjectRemovals() |
| 4824 | { |
| 4825 | auto& queuedObjRemovals = scriptQueuedObjectRemovals(); |
| 4826 | for (auto& objWithSfxFlag : queuedObjRemovals) |
| 4827 | { |
| 4828 | BASE_OBJECT* psObj = objWithSfxFlag.first; |
| 4829 | if (psObj->died) |
| 4830 | { |
| 4831 | debug(LOG_MSG, "Object %p is already dead, not processing", static_cast<void*>(psObj)); |
| 4832 | continue; |
| 4833 | } |
| 4834 | if (objWithSfxFlag.second) |
| 4835 | { |
| 4836 | switch (psObj->type) |
| 4837 | { |
| 4838 | case OBJ_STRUCTURE: destroyStruct((STRUCTURE*)psObj, gameTime); break; |
| 4839 | case OBJ_DROID: destroyDroid((DROID*)psObj, gameTime); break; |
| 4840 | case OBJ_FEATURE: destroyFeature((FEATURE*)psObj, gameTime); break; |
| 4841 | default: ASSERT(false, "Wrong game object type"); break; |
| 4842 | } |
| 4843 | } |
| 4844 | else |
| 4845 | { |
| 4846 | switch (psObj->type) |
| 4847 | { |
| 4848 | case OBJ_STRUCTURE: removeStruct((STRUCTURE*)psObj, true); break; |
| 4849 | case OBJ_DROID: removeDroidBase((DROID*)psObj); break; |
| 4850 | case OBJ_FEATURE: removeFeature((FEATURE*)psObj); break; |
| 4851 | default: ASSERT(false, "Wrong game object type"); break; |
| 4852 | } |
| 4853 | } |
| 4854 | } |
| 4855 | queuedObjRemovals.clear(); |
| 4856 | } |
nothing calls this directly
no test coverage detected