#include "../../script/helpers/entity.lua"

pMissionId = GetStringParam("mission_name_fp", "")

function init()
    if pMissionId == "" then cEntity:EnqueueDeletion() return end
    local is_completed = GetBool("savegame.mod.mission." .. pMissionId)
    if not is_completed then cEntity:EnqueueDeletion() return end

    local entities = cEntity:GetEntities("all")
    for i = 1, #entities do
        Delete(entities[i])
    end
    cEntity:EnqueueDeletion()
end
