qset command and crash fix

This commit is contained in:
kinther 2026-01-25 16:43:47 -08:00
parent 76210a81ae
commit 5273201d1b
6 changed files with 1226 additions and 6 deletions

View file

@ -61,7 +61,7 @@ Changes in v1.2.0-alpha:
Changes in v1.3.0-alpha:
* Migration away from OLC with new command "mset" and for builders to update NPC's
* Migration away from OLC with new commands "qcreate" and "qset" for builders to create quests
* Migration away from OLC with new commands "qcreate", "qset", and "qsave" for builders to create quests
* Updated mset, oset, and rset commands with missing parameters
* Added NPC extra descriptions for future support

View file

@ -1 +1,20 @@
quest = []
[[quest]]
vnum = 100
name = "Test quest"
description = "Test desc"
info = "You accept the test quest\n"
done = "You finished the test quest\n"
quit = "You quit the test quest.\n"
type = 0
quest_master = 100
flags = 0
target = 100
prev_quest = -1
next_quest = -1
prereq = -1
values = [0, 0, 0, 5, -1, -1, 1]
[quest.rewards]
coins = 100
exp = 0
obj_vnum = -1

View file

@ -258,6 +258,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "qedit" , "qedit" , POS_DEAD , do_oasis_qedit, LVL_BUILDER, 0 },
{ "qlist" , "qlist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_QLIST },
{ "qsave" , "qsav" , POS_DEAD , do_qsave , LVL_BUILDER, 0 },
{ "qset" , "qset" , POS_DEAD , do_qset , LVL_BUILDER, 0 },
{ "quaff" , "qua" , POS_RESTING , do_use , 0, SCMD_QUAFF },
{ "qecho" , "qec" , POS_DEAD , do_qcomm , LVL_GOD, SCMD_QECHO },
{ "quest" , "que" , POS_DEAD , do_quest , 0, 0 },

View file

@ -629,28 +629,28 @@ static obj_save_data *objsave_parse_objects_from_toml(toml_table_t *tab, const c
str = toml_get_string_dup(obj_tab, "name");
if (str) {
if (temp->name)
if (!VALID_OBJ_RNUM(temp) && temp->name)
free(temp->name);
temp->name = str;
}
str = toml_get_string_dup(obj_tab, "short");
if (str) {
if (temp->short_description)
if (!VALID_OBJ_RNUM(temp) && temp->short_description)
free(temp->short_description);
temp->short_description = str;
}
str = toml_get_string_dup(obj_tab, "description");
if (str) {
if (temp->description)
if (!VALID_OBJ_RNUM(temp) && temp->description)
free(temp->description);
temp->description = str;
}
str = toml_get_string_dup(obj_tab, "main_description");
if (str) {
if (temp->main_description)
if (!VALID_OBJ_RNUM(temp) && temp->main_description)
free(temp->main_description);
temp->main_description = str;
}

1199
src/set.c

File diff suppressed because it is too large Load diff

View file

@ -14,6 +14,7 @@ ACMD(do_rset);
ACMD(do_rcreate);
ACMD(do_ocreate);
ACMD(do_qcreate);
ACMD(do_qset);
ACMD(do_mcreate);
ACMD(do_mset);
ACMD(do_oset);