Skip to content

Commit

Permalink
Fixed global event settings not being initialized correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Espyo committed Aug 25, 2024
1 parent 064787d commit b519cf7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion Source/documents/Todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Current tasks (tasks being worked on, but not yet committed)

Next tasks (roughly sorted most important first)
--- To fix ---
Automatic gates aren't working
Pellet Posies aren't growing while off-camera

--- 0.26 ---
Expand Down
13 changes: 9 additions & 4 deletions Source/source/mob_script_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2484,18 +2484,23 @@ void insert_event_actions(
* @param mt The type of mob the events are going to.
* @param node The data node.
* @param out_actions The oaded actions are returned here.
* @param out_settings The settings for how to load the events are
* returned here.
* @param out_settings If not nullptr, the settings for how to load the
* events are returned here.
*/
void load_actions(
mob_type* mt, data_node* node,
vector<mob_action_call*>* out_actions, bitmask_8_t* out_settings
) {
if(out_settings) *out_settings = 0;
for(size_t a = 0; a < node->get_nr_of_children(); ++a) {
data_node* action_node = node->get_child(a);
if (action_node->name == "custom_actions_after") {
if (
out_settings && action_node->name == "custom_actions_after"
) {
enable_flag(*out_settings, EVENT_LOAD_FLAG_CUSTOM_ACTIONS_AFTER);
} else if (action_node->name == "global_actions_after") {
} else if (
out_settings && action_node->name == "global_actions_after"
) {
enable_flag(*out_settings, EVENT_LOAD_FLAG_GLOBAL_ACTIONS_AFTER);
} else {
mob_action_call* new_a = new mob_action_call();
Expand Down
2 changes: 1 addition & 1 deletion Source/source/mob_types/mob_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ void mob_type::load_from_data_node(
//Load init actions.
load_actions(
this,
script_file.get_child_by_name("init"), &init_actions, 0
script_file.get_child_by_name("init"), &init_actions, nullptr
);
//Load the rest of the script.
load_script(
Expand Down

0 comments on commit b519cf7

Please sign in to comment.