mirror of
https://github.com/tbamud/tbamud.git
synced 2025-09-22 05:50:48 +02:00
Renumbered UNUSED triggers to UNUSED# to make it easier to unset them when cha
nging trig types. (thanks Parna) Fixed double free in IBT that caused crash on /a or saving without any descrip tion.
This commit is contained in:
parent
66e4b7ec0c
commit
32880daf6b
6 changed files with 1136 additions and 1123 deletions
|
@ -36,6 +36,9 @@ Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
||||||
(lots of major bugfixes too)
|
(lots of major bugfixes too)
|
||||||
@
|
@
|
||||||
tbaMUD 3.61
|
tbaMUD 3.61
|
||||||
|
[Dec 07 2009] - Rumble
|
||||||
|
Renumbered UNUSED triggers to UNUSED# to make it easier to unset them when changing trig types. (thanks Parna)
|
||||||
|
Fixed double free in IBT that caused crash on /a or saving without any description.
|
||||||
[Dec 06 2009] - Rumble
|
[Dec 06 2009] - Rumble
|
||||||
Fixed medit sex and position numbering. The numbering was wrong with the new column_list.
|
Fixed medit sex and position numbering. The numbering was wrong with the new column_list.
|
||||||
Fixed medit autoroll so it would recognize a change and save.
|
Fixed medit autoroll so it would recognize a change and save.
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
Text test2~
|
||||||
|
Body test2
|
||||||
|
~
|
||||||
|
Name Rumble~
|
||||||
|
Level 34
|
||||||
|
Room 1204
|
||||||
|
Flags 1 0 0 0
|
||||||
|
End
|
||||||
|
Text test 5~
|
||||||
|
Body test5
|
||||||
|
~
|
||||||
|
Name Rumble~
|
||||||
|
Level 34
|
||||||
|
Room 1204
|
||||||
|
Flags 0 0 0 0
|
||||||
|
End
|
|
@ -857,21 +857,21 @@ const char *otrig_types[] = {
|
||||||
"Global",
|
"Global",
|
||||||
"Random",
|
"Random",
|
||||||
"Command",
|
"Command",
|
||||||
"UNUSED",
|
"UNUSED1",
|
||||||
"UNUSED",
|
"UNUSED2",
|
||||||
"Timer",
|
"Timer",
|
||||||
"Get",
|
"Get",
|
||||||
"Drop",
|
"Drop",
|
||||||
"Give",
|
"Give",
|
||||||
"Wear",
|
"Wear",
|
||||||
"UNUSED",
|
"UNUSED3",
|
||||||
"Remove",
|
"Remove",
|
||||||
"UNUSED",
|
"UNUSED4",
|
||||||
"Load",
|
"Load",
|
||||||
"UNUSED",
|
"UNUSED5",
|
||||||
"Cast",
|
"Cast",
|
||||||
"Leave",
|
"Leave",
|
||||||
"UNUSED",
|
"UNUSED6",
|
||||||
"Consume",
|
"Consume",
|
||||||
"Time",
|
"Time",
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -883,17 +883,17 @@ const char *wtrig_types[] = {
|
||||||
"Random",
|
"Random",
|
||||||
"Command",
|
"Command",
|
||||||
"Speech",
|
"Speech",
|
||||||
"UNUSED",
|
"UNUSED1",
|
||||||
"Zone Reset",
|
"Zone Reset",
|
||||||
"Enter",
|
"Enter",
|
||||||
"Drop",
|
"Drop",
|
||||||
"UNUSED",
|
"UNUSED2",
|
||||||
"UNUSED",
|
"UNUSED3",
|
||||||
"UNUSED",
|
"UNUSED4",
|
||||||
"UNUSED",
|
"UNUSED5",
|
||||||
"UNUSED",
|
"UNUSED6",
|
||||||
"UNUSED",
|
"UNUSED7",
|
||||||
"UNUSED",
|
"UNUSED8",
|
||||||
"Cast",
|
"Cast",
|
||||||
"Leave",
|
"Leave",
|
||||||
"Door",
|
"Door",
|
||||||
|
|
198
src/ibt.h
198
src/ibt.h
|
@ -1,99 +1,99 @@
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* File: ibt.h Part of tbaMUD *
|
* File: ibt.h Part of tbaMUD *
|
||||||
* Usage: Loading/saving/editing of Ideas, Bugs and Typos lists *
|
* Usage: Loading/saving/editing of Ideas, Bugs and Typos lists *
|
||||||
* *
|
* *
|
||||||
* All rights reserved. See license for complete information. *
|
* All rights reserved. See license for complete information. *
|
||||||
* *
|
* *
|
||||||
* Created by Vash (aka Frenze) for Trigun MUD and the tbaMUD codebase *
|
* Created by Vash (aka Frenze) for Trigun MUD and the tbaMUD codebase *
|
||||||
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
|
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
|
||||||
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
|
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
typedef struct ibt_data IBT_DATA;
|
typedef struct ibt_data IBT_DATA;
|
||||||
|
|
||||||
#define MAX_IBT_LENGTH 2048
|
#define MAX_IBT_LENGTH 2048
|
||||||
#define MAX_IBTNOTE_LENGTH 2048
|
#define MAX_IBTNOTE_LENGTH 2048
|
||||||
|
|
||||||
/* Subcommands, also used for 'modes' */
|
/* Subcommands, also used for 'modes' */
|
||||||
#define SCMD_BUG 0
|
#define SCMD_BUG 0
|
||||||
#define SCMD_IDEA 1
|
#define SCMD_IDEA 1
|
||||||
#define SCMD_TYPO 2
|
#define SCMD_TYPO 2
|
||||||
|
|
||||||
/* Flag array size (min = 4) */
|
/* Flag array size (min = 4) */
|
||||||
#define IBT_ARRAY_MAX 4
|
#define IBT_ARRAY_MAX 4
|
||||||
|
|
||||||
/* List of flags for Ideas, Bugs and Typos */
|
/* List of flags for Ideas, Bugs and Typos */
|
||||||
#define IBT_RESOLVED 0
|
#define IBT_RESOLVED 0
|
||||||
#define IBT_IMPORTANT 1
|
#define IBT_IMPORTANT 1
|
||||||
#define IBT_INPROGRESS 2
|
#define IBT_INPROGRESS 2
|
||||||
|
|
||||||
#define NUM_IBT_FLAGS 3
|
#define NUM_IBT_FLAGS 3
|
||||||
|
|
||||||
/* IBT Type returns 'Idea', 'Bug' or 'Typo' when in OLC */
|
/* IBT Type returns 'Idea', 'Bug' or 'Typo' when in OLC */
|
||||||
#define IBT_TYPE (ibt_types[(OLC_VAL(d))])
|
#define IBT_TYPE (ibt_types[(OLC_VAL(d))])
|
||||||
|
|
||||||
#define IBT_FLAGS(x) ((x)->flags)
|
#define IBT_FLAGS(x) ((x)->flags)
|
||||||
#define IBT_FLAGGED(x,y) (IS_SET_AR(((x)->flags), (y)))
|
#define IBT_FLAGGED(x,y) (IS_SET_AR(((x)->flags), (y)))
|
||||||
|
|
||||||
/* IBT Editor OLC modes */
|
/* IBT Editor OLC modes */
|
||||||
#define IBTEDIT_CONFIRM_SAVESTRING 1
|
#define IBTEDIT_CONFIRM_SAVESTRING 1
|
||||||
#define IBTEDIT_MAIN_MENU 2
|
#define IBTEDIT_MAIN_MENU 2
|
||||||
#define IBTEDIT_NAME 3
|
#define IBTEDIT_NAME 3
|
||||||
#define IBTEDIT_ROOM 4
|
#define IBTEDIT_ROOM 4
|
||||||
#define IBTEDIT_TEXT 5
|
#define IBTEDIT_TEXT 5
|
||||||
#define IBTEDIT_FLAGS 6
|
#define IBTEDIT_FLAGS 6
|
||||||
#define IBTEDIT_BODY 7
|
#define IBTEDIT_BODY 7
|
||||||
#define IBTEDIT_NOTES 8
|
#define IBTEDIT_NOTES 8
|
||||||
|
|
||||||
#ifdef KEY
|
#ifdef KEY
|
||||||
#undef KEY
|
#undef KEY
|
||||||
#endif
|
#endif
|
||||||
#define KEY( literal, field, value ) \
|
#define KEY( literal, field, value ) \
|
||||||
if ( !str_cmp( word, literal ) ) \
|
if ( !str_cmp( word, literal ) ) \
|
||||||
{ \
|
{ \
|
||||||
field = value; \
|
field = value; \
|
||||||
fMatch = TRUE; \
|
fMatch = TRUE; \
|
||||||
break; \
|
break; \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TXT_KEY should be used with fread_line, as it uses a static string, so should be copied */
|
/* TXT_KEY should be used with fread_line, as it uses a static string, so should be copied */
|
||||||
#ifdef TXT_KEY
|
#ifdef TXT_KEY
|
||||||
#undef TXT_KEY
|
#undef TXT_KEY
|
||||||
#endif
|
#endif
|
||||||
#define TXT_KEY( literal, field, value ) \
|
#define TXT_KEY( literal, field, value ) \
|
||||||
if ( !str_cmp( word, literal ) ) \
|
if ( !str_cmp( word, literal ) ) \
|
||||||
{ \
|
{ \
|
||||||
if (field) STRFREE(field); \
|
if (field) STRFREE(field); \
|
||||||
field = STRALLOC(value); \
|
field = STRALLOC(value); \
|
||||||
fMatch = TRUE; \
|
fMatch = TRUE; \
|
||||||
break; \
|
break; \
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ibt_data
|
struct ibt_data
|
||||||
{
|
{
|
||||||
IBT_DATA *next; /**< Pointer to next IBT in the list */
|
IBT_DATA *next; /**< Pointer to next IBT in the list */
|
||||||
IBT_DATA *prev; /**< Pointer to previous IBT in the list */
|
IBT_DATA *prev; /**< Pointer to previous IBT in the list */
|
||||||
char *text; /**< Header Text for this IBT */
|
char *text; /**< Header Text for this IBT */
|
||||||
char *body; /**< Body Text for this IBT */
|
char *body; /**< Body Text for this IBT */
|
||||||
char *name; /**< Name of the person who reported this IBT */
|
char *name; /**< Name of the person who reported this IBT */
|
||||||
char *notes; /**< Resolution Notes added by Administrators */
|
char *notes; /**< Resolution Notes added by Administrators */
|
||||||
int level; /**< Level of the person who reported this IBT */
|
int level; /**< Level of the person who reported this IBT */
|
||||||
room_vnum room; /**< Room in which this IBT was reported */
|
room_vnum room; /**< Room in which this IBT was reported */
|
||||||
int flags[IBT_ARRAY_MAX]; /**< IBT flags */
|
int flags[IBT_ARRAY_MAX]; /**< IBT flags */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern IBT_DATA *first_bug;
|
extern IBT_DATA *first_bug;
|
||||||
extern IBT_DATA *last_bug;
|
extern IBT_DATA *last_bug;
|
||||||
extern IBT_DATA *first_idea;
|
extern IBT_DATA *first_idea;
|
||||||
extern IBT_DATA *last_idea;
|
extern IBT_DATA *last_idea;
|
||||||
extern IBT_DATA *first_typo;
|
extern IBT_DATA *first_typo;
|
||||||
extern IBT_DATA *last_typo;
|
extern IBT_DATA *last_typo;
|
||||||
|
|
||||||
/* Functions in ibt.c that are used externally */
|
/* Functions in ibt.c that are used externally */
|
||||||
ACMD(do_ibt);
|
ACMD(do_ibt);
|
||||||
ACMD(do_oasis_ibtedit);
|
ACMD(do_oasis_ibtedit);
|
||||||
void save_ibt_file(int mode);
|
void save_ibt_file(int mode);
|
||||||
void load_ibt_file(int mode);
|
void load_ibt_file(int mode);
|
||||||
void ibtedit_parse(struct descriptor_data *d, char *arg);
|
void ibtedit_parse(struct descriptor_data *d, char *arg);
|
||||||
void ibtedit_string_cleanup(struct descriptor_data *d, int terminator);
|
void ibtedit_string_cleanup(struct descriptor_data *d, int terminator);
|
||||||
|
|
||||||
|
|
|
@ -243,8 +243,6 @@ static void playing_string_cleanup(struct descriptor_data *d, int action)
|
||||||
save_ibt_file(SCMD_IDEA);
|
save_ibt_file(SCMD_IDEA);
|
||||||
} else {
|
} else {
|
||||||
write_to_output(d, "Idea aborted!\r\n");
|
write_to_output(d, "Idea aborted!\r\n");
|
||||||
free(*d->str);
|
|
||||||
free(d->str);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PLR_FLAGGED(d->character, PLR_BUG)) {
|
if (PLR_FLAGGED(d->character, PLR_BUG)) {
|
||||||
|
@ -253,8 +251,6 @@ static void playing_string_cleanup(struct descriptor_data *d, int action)
|
||||||
save_ibt_file(SCMD_BUG);
|
save_ibt_file(SCMD_BUG);
|
||||||
} else {
|
} else {
|
||||||
write_to_output(d, "Bug aborted!\r\n");
|
write_to_output(d, "Bug aborted!\r\n");
|
||||||
free(*d->str);
|
|
||||||
free(d->str);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PLR_FLAGGED(d->character, PLR_TYPO)) {
|
if (PLR_FLAGGED(d->character, PLR_TYPO)) {
|
||||||
|
@ -263,8 +259,6 @@ static void playing_string_cleanup(struct descriptor_data *d, int action)
|
||||||
save_ibt_file(SCMD_TYPO);
|
save_ibt_file(SCMD_TYPO);
|
||||||
} else {
|
} else {
|
||||||
write_to_output(d, "Typo aborted!\r\n");
|
write_to_output(d, "Typo aborted!\r\n");
|
||||||
free(*d->str);
|
|
||||||
free(d->str);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue