Skip to content

adds missing exec error #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2022
Merged

adds missing exec error #26

merged 1 commit into from
Dec 5, 2022

Conversation

zaucy
Copy link
Member

@zaucy zaucy commented Dec 5, 2022

also formatted some stuff

Comment on lines +1100 to +1124
auto _validate_action(ecsact_registry_id registry_id, ecsact_action& action)
-> ecsact_execute_systems_error {
using boost::mp11::mp_for_each;

auto& info = _registries.at(registry_id);
auto result = ECSACT_EXEC_SYS_OK;

mp_for_each<typename package::actions>([&]<typename A>(A) {
if(A::id != action.action_id) {
return;
}
constexpr auto fields_info = ecsact::fields_info<A>();
for(auto& field : fields_info) {
if(field.storage_type == ECSACT_ENTITY_TYPE) {
auto entity_field =
field.template get<ecsact_entity_id>(action.action_data);
if(!info.entities_map.contains(entity_field)) {
result = ECSACT_EXEC_SYS_ERR_ACTION_ENTITY_INVALID;
}
}
}
});

return result;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the relevant part

@zaucy zaucy merged commit 9a357b1 into main Dec 5, 2022
@zaucy zaucy deleted the feat/system-exec-errors branch December 5, 2022 21:48
@zaucy zaucy mentioned this pull request Dec 16, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant