| 2556 | } |
| 2557 | |
| 2558 | int ASCreateObject(const std::string& path, bool exclude_from_save) { |
| 2559 | int id = -1; |
| 2560 | EntityDescriptionList desc_list; |
| 2561 | std::string file_type; |
| 2562 | Path source; |
| 2563 | ActorsEditor_LoadEntitiesFromFile(path, desc_list, &file_type, &source); |
| 2564 | for (auto& i : desc_list) { |
| 2565 | Object* obj = MapEditor::AddEntityFromDesc(the_scenegraph, i, false); |
| 2566 | if (obj) { |
| 2567 | obj->exclude_from_undo = exclude_from_save; |
| 2568 | obj->exclude_from_save = exclude_from_save; |
| 2569 | obj->permission_flags = 0; |
| 2570 | id = obj->GetID(); |
| 2571 | } else { |
| 2572 | LOGE << "Failed at creating object from: " << path << std::endl; |
| 2573 | } |
| 2574 | } |
| 2575 | return id; |
| 2576 | } |
| 2577 | |
| 2578 | int ASCreateObject2(const std::string& path) { |
| 2579 | return ASCreateObject(path, true); |
no test coverage detected