@@ -26,24 +26,47 @@ auto UEcsactSyncRunner::Tick(float DeltaTime) -> void {
2626 EcsactUnrealExecution::DeltaTime_ = DeltaTime;
2727
2828 if (registry_id == ECSACT_INVALID_ID (registry)) {
29- UE_LOG (
30- Ecsact,
31- Warning,
32- TEXT (" UEcsactSyncRunner register_id is unset. Creating one for you. We "
33- " recommend creating your own instead." )
34- );
35- registry_id = ecsact_create_registry (" Default Registry" );
29+ if (ecsact_create_registry) {
30+ UE_LOG (
31+ Ecsact,
32+ Warning,
33+ TEXT (" UEcsactSyncRunner register_id is unset. Creating one for you. We "
34+ " recommend creating your own instead." )
35+ );
36+ registry_id = ecsact_create_registry (" Default Registry" );
37+ } else {
38+ UE_LOG (
39+ Ecsact,
40+ Error,
41+ TEXT (" UEcsactSyncRunner registry_id is unset and "
42+ " ecsact_create_registry is unavailable - unable to automatically "
43+ " create an Ecsact registry" )
44+ );
45+ }
3646 }
3747
38- ecsact_execution_options* exec_opts = nullptr ;
39- if (ExecutionOptions != nullptr && ExecutionOptions->IsNotEmpty ()) {
40- exec_opts = ExecutionOptions->GetCPtr ();
41- }
48+ if (registry_id != ECSACT_INVALID_ID (registry)) {
49+ ecsact_execution_options* exec_opts = nullptr ;
50+ if (ExecutionOptions != nullptr && ExecutionOptions->IsNotEmpty ()) {
51+ exec_opts = ExecutionOptions->GetCPtr ();
52+ }
4253
43- auto err =
44- ecsact_execute_systems (registry_id, 1 , exec_opts, GetEventsCollector ());
45- if (err != ECSACT_EXEC_SYS_OK) {
46- UE_LOG (Ecsact, Error, TEXT (" Ecsact execution failed" ));
54+ if (ecsact_execute_systems) {
55+ auto err =
56+ ecsact_execute_systems (registry_id, 1 , exec_opts, GetEventsCollector ());
57+ if (err != ECSACT_EXEC_SYS_OK) {
58+ UE_LOG (Ecsact, Error, TEXT (" Ecsact execution failed" ));
59+ }
60+ if (ExecutionOptions) {
61+ ExecutionOptions->Clear ();
62+ }
63+ } else {
64+ UE_LOG (
65+ Ecsact,
66+ Error,
67+ TEXT (" ecsact_execute_systems unavailable - unable to execute systems" )
68+ );
69+ }
4770 }
4871}
4972
0 commit comments