File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,9 +118,6 @@ namespace ECS::Systems::Editor
118118 return false ;
119119
120120 entt::registry::context& ctx = registries->gameRegistry ->ctx ();
121- if (!ctx.contains <Singletons::EditorSelection>())
122- return false ;
123-
124121 auto & selection = ctx.get <Singletons::EditorSelection>();
125122 if (selection.selectedEntity == entt::null || !registries->gameRegistry ->valid (selection.selectedEntity ))
126123 return false ;
@@ -324,9 +321,6 @@ namespace ECS::Systems::Editor
324321 void EditorTools::SetSelectedEntity (entt::registry& registry, entt::entity entity)
325322 {
326323 entt::registry::context& ctx = registry.ctx ();
327- if (!ctx.contains <Singletons::EditorSelection>())
328- return ;
329-
330324 auto & selection = ctx.get <Singletons::EditorSelection>();
331325 if (selection.selectedEntity == entity)
332326 return ;
@@ -338,9 +332,6 @@ namespace ECS::Systems::Editor
338332 void EditorTools::Update (entt::registry& registry, f32 /* deltaTime*/ )
339333 {
340334 entt::registry::context& ctx = registry.ctx ();
341- if (!ctx.contains <Singletons::EditorSelection>())
342- return ;
343-
344335 auto & selection = ctx.get <Singletons::EditorSelection>();
345336
346337 GameRenderer* gameRenderer = ServiceLocator::GetGameRenderer ();
Original file line number Diff line number Diff line change @@ -190,12 +190,9 @@ namespace Scripting::Asset
190190
191191 EnttRegistries* registries = ServiceLocator::GetEnttRegistries ();
192192 entt::registry::context& ctx = registries->gameRegistry ->ctx ();
193- if (ctx.contains <ECS ::Singletons::EditorSelection>())
194- {
195- auto & selection = ctx.get <ECS ::Singletons::EditorSelection>();
196- selection.dragSpawnRequested = true ;
197- selection.dragSpawnModelPath = relativeRaw;
198- }
193+ auto & selection = ctx.get <ECS ::Singletons::EditorSelection>();
194+ selection.dragSpawnRequested = true ;
195+ selection.dragSpawnModelPath = relativeRaw;
199196
200197 return 0 ;
201198 }
Original file line number Diff line number Diff line change @@ -48,8 +48,6 @@ namespace Scripting::Editor
4848 if (!registries || !registries->gameRegistry )
4949 return nullptr ;
5050 auto & ctx = registries->gameRegistry ->ctx ();
51- if (!ctx.contains <ECS ::Singletons::EditorSelection>())
52- return nullptr ;
5351 return &ctx.get <ECS ::Singletons::EditorSelection>();
5452 }
5553
You can’t perform that action at this time.
0 commit comments