Dreikblack Posted February 11 Share Posted February 11 Template map. If you hit Enter before activating doors SlidingDoor count will be zero but if you do it after triggering a doors a count will be few dozens. #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { RegisterComponents(); auto fiplugin = LoadPlugin("Plugins/FITextureLoader"); auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto framebuffer = CreateFramebuffer(window); auto world = CreateWorld(); WString mapname = "Maps/start.ultra"; auto scene = LoadMap(world, mapname); std::weak_ptr<SlidingDoor> slidingDoor; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyDown(KEY_ENTER)) { for (auto& entity : scene->entities) { if (entity && entity->GetComponent<SlidingDoor>()) { slidingDoor = entity->GetComponent<SlidingDoor>(); scene->RemoveEntity(entity); Print(slidingDoor.use_count()); break; } } } world->Update(); world->Render(framebuffer); } return 0; } Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted February 11 Solution Share Posted February 11 I am changing it so that event listeners store a weak pointer to an extra object and automatically self-delete if an extra object is defined but gets deleted elsewhere. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Dreikblack Posted February 15 Author Share Posted February 15 It was not included in last beta update? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 15 Share Posted February 15 I think it is. I just checked with the source build. You are opted into the beta branch on Steam, right? The current build number of the editor on Steam is 485. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Dreikblack Posted February 15 Author Share Posted February 15 44 minutes ago, Josh said: You are opted into the beta branch on Steam, right? Yes. I will check again later. Slider door was not changed and no changes in project manager to sync when i was checking last time after update. Quote Link to comment Share on other sites More sharing options...
Josh Posted February 15 Share Posted February 15 You should be getting big 2+ GB updates on Steam. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Dreikblack Posted February 15 Author Share Posted February 15 I guess i'm was looking in wrong place. Was expected that callbacks will have weak_ptr for extra object in parameters now. Example and my case seems working now how intended 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.