From 3b97afbf9332b21e15bfa09bfd78470a6da6e357 Mon Sep 17 00:00:00 2001 From: Lucien Date: Sun, 5 Jan 2025 08:42:17 -0800 Subject: [PATCH] Enforced default position for mobs --- src/act.wizard.cpp | 4 ++-- src/db.cpp | 1 + src/medit.cpp | 16 ++++++---------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/act.wizard.cpp b/src/act.wizard.cpp index 17b0dcb6d..ad302ed9f 100644 --- a/src/act.wizard.cpp +++ b/src/act.wizard.cpp @@ -1806,7 +1806,7 @@ void do_stat_character(struct char_data * ch, struct char_data * k) strlcat(buf, "\r\n", sizeof(buf)); strlcat(buf, "Default position: ", sizeof(buf)); - sprinttype((k->mob_specials.default_pos), position_types, buf2, sizeof(buf2)); + sprinttype(GET_DEFAULT_POS(k), position_types, buf2, sizeof(buf2)); strlcat(buf, buf2, sizeof(buf)); snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), ", Idle Timer: [%d], Emote Timer: [%d]\r\n", k->char_specials.timer, k->char_specials.last_social_action); @@ -1962,7 +1962,7 @@ void do_stat_mobile(struct char_data * ch, struct char_data * k) strlcat(buf, "Default position: ", sizeof(buf)); - sprinttype((k->mob_specials.default_pos), position_types, buf2, sizeof(buf2)); + sprinttype(GET_DEFAULT_POS(k), position_types, buf2, sizeof(buf2)); strlcat(buf, buf2, sizeof(buf)); strlcat(buf, " Mob Spec-Proc: ", sizeof(buf)); if (mob_index[GET_MOB_RNUM(k)].func || mob_index[GET_MOB_RNUM(k)].sfunc) diff --git a/src/db.cpp b/src/db.cpp index 2df4196c2..78b62bdf4 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -4277,6 +4277,7 @@ struct char_data *read_mobile(int nr, int type) mob->player.time.logon = time(0); mob->player.tradition = mob->player.aspect = 0; mob->char_specials.saved.left_handed = (!number(0, 9) ? 1 : 0); + GET_POS(mob) = (GET_DEFAULT_POS(mob) > 0 ? GET_DEFAULT_POS(mob) : POS_STANDING); mob_index[i].number++; diff --git a/src/medit.cpp b/src/medit.cpp index 0800f5841..3a1e6a8b4 100644 --- a/src/medit.cpp +++ b/src/medit.cpp @@ -1410,6 +1410,7 @@ void medit_parse(struct descriptor_data *d, const char *arg) GET_MAX_PHYSICAL(MOB) = number * 100; GET_PHYSICAL(MOB) = number * 100; if (GET_MAX_PHYSICAL(MOB) <= 0) { + send_to_char("^RAt 0 max phys, this mob will never be treatable and will always be mortally wounded.^n\r\n", CH); GET_DEFAULT_POS(MOB) = MIN(GET_DEFAULT_POS(MOB), POS_MORTALLYW); } medit_disp_menu(d); @@ -1425,6 +1426,7 @@ void medit_parse(struct descriptor_data *d, const char *arg) GET_MAX_MENTAL(MOB) = number * 100; GET_MENTAL(MOB) = number * 100; if (GET_MAX_MENTAL(MOB) <= 0) { + send_to_char("^RAt 0 max ment, this mob will never be conscious and will always be stunned.^n\r\n", CH); GET_DEFAULT_POS(MOB) = MIN(GET_DEFAULT_POS(MOB), POS_STUNNED); } medit_disp_menu(d); @@ -1787,12 +1789,6 @@ void medit_parse(struct descriptor_data *d, const char *arg) medit_disp_pos_menu(d); } else { GET_DEFAULT_POS(MOB) = GET_POS(MOB) = number; - if (GET_DEFAULT_POS(MOB) <= POS_MORTALLYW) { - GET_MAX_PHYSICAL(MOB) = GET_PHYSICAL(MOB) = 0; - GET_MAX_MENTAL(MOB) = GET_MENTAL(MOB) = 0; - } else if (GET_DEFAULT_POS(MOB) <= POS_STUNNED) { - GET_MAX_MENTAL(MOB) = GET_MENTAL(MOB) = 0; - } medit_disp_menu(d); } break; @@ -1881,12 +1877,12 @@ void write_mobs_to_disk(vnum_t zone_num) pc_race_types_for_wholist[(int)mob->player.race], genders[(int)mob->player.pronouns]); - if (mob->char_specials.position != POS_STANDING) + if (GET_POS(mob) != POS_STANDING) fprintf(fp, "Position:\t%s\n", - position_types[(int)mob->char_specials.position]); - if (mob->mob_specials.default_pos) + position_types[(int)GET_POS(mob)]); + if (GET_DEFAULT_POS(mob)) fprintf(fp, "DefaultPos:\t%s\n", - position_types[(int)mob->mob_specials.default_pos]); + position_types[(int)GET_DEFAULT_POS(mob)]); if (mob->mob_specials.attack_type != TYPE_HIT) fprintf(fp, "AttackType:\t%s\n",