diff --git a/src/act.wizard.c b/src/act.wizard.c index 48c288c..8159ce3 100644 --- a/src/act.wizard.c +++ b/src/act.wizard.c @@ -2794,7 +2794,7 @@ ACMD(do_wizutil) act("A sudden fireball conjured from nowhere thaws $n!", FALSE, vict, 0, 0, TO_ROOM); break; case SCMD_UNAFFECT: - if (vict->affected || AFF_FLAGS(vict)) { + if (vict->affected || ANY_AFF_FLAGS(vict)) { while (vict->affected) affect_remove(vict, vict->affected); for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) diff --git a/src/castle.c b/src/castle.c index 15a4c33..df30806 100644 --- a/src/castle.c +++ b/src/castle.c @@ -374,9 +374,9 @@ SPECIAL(king_welmar) "$n proclaims 'principe dignos'." }; - const char bedroom_path[] = "s33004o1c1S."; - const char throne_path[] = "W3o3cG52211rg."; - const char monolog_path[] = "ABCDPPPP."; + static const char bedroom_path[] = "s33004o1c1S."; + static const char throne_path[] = "W3o3cG52211rg."; + static const char monolog_path[] = "ABCDPPPP."; static const char *path; static int path_index; diff --git a/src/improved-edit.c b/src/improved-edit.c index 2312297..b29b727 100644 --- a/src/improved-edit.c +++ b/src/improved-edit.c @@ -367,8 +367,8 @@ void parse_edit_action(int command, char *string, struct descriptor_data *d) s++; temp = *s; *s = '\0'; - char buf3[9]; - sprintf(buf3, "%4d: ", (i - 1)); + char buf3[16]; + snprintf(buf3, sizeof buf3, "%4d: ", (i - 1)); strncat(buf, buf3, sizeof(buf) - strlen(buf) - 1); strncat(buf, t, sizeof(buf) - strlen(buf) - 1); *s = temp; diff --git a/src/interpreter.c b/src/interpreter.c index a68bfcc..40322d0 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -36,6 +36,7 @@ #include "prefedit.h" #include "ibt.h" #include "mud_event.h" +#include "modify.h" /* to ensure page_string is available */ /* local (file scope) functions */ static int perform_dupe_check(struct descriptor_data *d); diff --git a/src/quest.c b/src/quest.c index 0103647..be5616d 100644 --- a/src/quest.c +++ b/src/quest.c @@ -616,7 +616,7 @@ static void quest_show(struct char_data *ch, mob_vnum qm) send_to_char(ch, "There are no quests available here at the moment.\r\n"); } -static void quest_stat(struct char_data *ch, char argument[MAX_STRING_LENGTH]) +static void quest_stat(struct char_data *ch, const char *argument) { qst_rnum rnum; mob_rnum qmrnum; diff --git a/src/spec_procs.c b/src/spec_procs.c index 65447c3..1f2e687 100644 --- a/src/spec_procs.c +++ b/src/spec_procs.c @@ -147,9 +147,9 @@ SPECIAL(mayor) { char actbuf[MAX_INPUT_LENGTH]; - const char open_path[] = + static const char open_path[] = "W3a3003b33000c111d0d111Oe333333Oe22c222112212111a1S."; - const char close_path[] = + static const char close_path[] = "W3a3003b33000c111d0d111CE333333CE22c222112212111a1S."; static const char *path = NULL; diff --git a/src/utils.h b/src/utils.h index 2dc961f..608fd1d 100644 --- a/src/utils.h +++ b/src/utils.h @@ -15,6 +15,8 @@ * functions, move functions, char_from_furniture) out of utils and declare / * define elsewhere. */ +#include + #ifndef _UTILS_H_ /* Begin header file protection */ #define _UTILS_H_ @@ -1149,4 +1151,11 @@ static inline int GET_SPELL_SAVE_DC(struct char_data *ch, int spellnum, int misc return dc; } +/* Quick check for any affect flag out of the array */ +static inline bool ANY_AFF_FLAGS(const struct char_data *ch) { + for (int i = 0; i < AF_ARRAY_MAX; ++i) + if (AFF_FLAGS(ch)[i] != 0) return true; + return false; +} + #endif /* _UTILS_H_ */