Skip to content

Commit 3d423b5

Browse files
committed
Did the same thing for SET_BOX_TOOLTIP_ID
1 parent 4bf5e53 commit 3d423b5

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

src/lvl_script_commands.c

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4714,15 +4714,25 @@ static void set_box_tooltip_process(struct ScriptContext* context)
47144714
snprintf(gameadd.box_tooltip[idx], MESSAGE_TEXT_LEN, "%s", context->value->strs[2]);
47154715
}
47164716

4717-
static void set_box_tooltip_id(const struct ScriptLine *scline)
4717+
static void set_box_tooltip_id_check(const struct ScriptLine *scline)
47184718
{
4719-
if ((scline->np[0] < 0) || (scline->np[0] >= CUSTOM_BOX_COUNT))
4720-
{
4721-
SCRPTERRLOG("Invalid CUSTOM_BOX number (%ld)", scline->np[0]);
4722-
return;
4723-
}
4724-
int idx = scline->np[0];
4725-
snprintf(gameadd.box_tooltip[idx], MESSAGE_TEXT_LEN, "%s", get_string(scline->np[1]));
4719+
ALLOCATE_SCRIPT_VALUE(scline->command, 0);
4720+
if ((scline->np[0] < 0) || (scline->np[0] >= CUSTOM_BOX_COUNT))
4721+
{
4722+
SCRPTERRLOG("Invalid CUSTOM_BOX number (%ld)", scline->np[0]);
4723+
DEALLOCATE_SCRIPT_VALUE;
4724+
return;
4725+
}
4726+
value->shorts[0] = scline->np[0];
4727+
value->shorts[1] = scline->np[1];
4728+
PROCESS_SCRIPT_VALUE(scline->command);
4729+
}
4730+
4731+
static void set_box_tooltip_id_process(struct ScriptContext* context)
4732+
{
4733+
int idx = context->value->shorts[0];
4734+
int string = context->value->shorts[1];
4735+
snprintf(gameadd.box_tooltip[idx], MESSAGE_TEXT_LEN, "%s", get_string(string));
47264736
}
47274737

47284738
static void change_slab_owner_check(const struct ScriptLine *scline)
@@ -7594,7 +7604,7 @@ const struct CommandDesc command_desc[] = {
75947604
{"SET_SACRIFICE_RECIPE", "AAA+ ", Cmd_SET_SACRIFICE_RECIPE, &set_sacrifice_recipe_check, &set_sacrifice_recipe_process},
75957605
{"REMOVE_SACRIFICE_RECIPE", "A+ ", Cmd_REMOVE_SACRIFICE_RECIPE, &remove_sacrifice_recipe_check, &set_sacrifice_recipe_process},
75967606
{"SET_BOX_TOOLTIP", "NA ", Cmd_SET_BOX_TOOLTIP, &set_box_tooltip_check, &set_box_tooltip_process},
7597-
{"SET_BOX_TOOLTIP_ID", "NN ", Cmd_SET_BOX_TOOLTIP_ID, &set_box_tooltip_id, &null_process},
7607+
{"SET_BOX_TOOLTIP_ID", "NN ", Cmd_SET_BOX_TOOLTIP_ID, &set_box_tooltip_id_check, &set_box_tooltip_id_process},
75987608
{"CHANGE_SLAB_OWNER", "NNPa ", Cmd_CHANGE_SLAB_OWNER, &change_slab_owner_check, &change_slab_owner_process},
75997609
{"CHANGE_SLAB_TYPE", "NNSa ", Cmd_CHANGE_SLAB_TYPE, &change_slab_type_check, &change_slab_type_process},
76007610
{"CREATE_EFFECTS_LINE", "LLNNNA ", Cmd_CREATE_EFFECTS_LINE, &create_effects_line_check, &create_effects_line_process},

0 commit comments

Comments
 (0)