MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / DuplicateObject

Method DuplicateObject

Source/Editors/map_editor.cpp:2862–2875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2860}
2861
2862int MapEditor::DuplicateObject(const Object* obj) {
2863 EntityDescription desc;
2864 obj->GetDesc(desc);
2865 ClearDescID(&desc);
2866 Object* new_obj = AddEntityFromDesc(scenegraph_, desc, false);
2867 int id = -1;
2868 if (new_obj) {
2869 id = new_obj->GetID();
2870 } else {
2871 LOGE << "Failed at creating a duplicate" << std::endl;
2872 }
2873 QueueSaveHistoryState();
2874 return id;
2875}
2876
2877Object* MapEditor::GetSelectedCameraObject() {
2878 Object* selected = NULL;

Callers 1

ASDuplicateObjectFunction · 0.80

Calls 3

ClearDescIDFunction · 0.85
GetDescMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected