Fix oedit oval bug with non-armor items

This commit is contained in:
kinther 2025-08-31 10:38:03 -07:00
parent 649c03a4fb
commit fa5a771f88
5 changed files with 314 additions and 205 deletions

View file

@ -167,11 +167,83 @@ A belt made of black cloth lies here.~
10 0 0 0
1 25 0 0 0
#121
unfinished object~
small bag~
a small bag~
An unfinished object is lying here.~
A small bag made of cloth lies here.~
~
0 0 0 0 0 a 0 0 0 0 0 0 0
0 0 0 0
0 0 0 0 0
15 0 0 0 0 a 0 0 0 0 0 0 0
15 0 0 0
1 25 0 0 0
#122
large bag~
a large bag~
A large bag made of cloth is lying here.~
~
15 0 0 0 0 a 0 0 0 0 0 0 0
50 0 0 0
1 50 0 0 0
#123
pair boots~
a pair of boots~
A pair of simple leather boots are here.~
~
9 0 0 0 0 ag 0 0 0 0 0 0 0
1 1 0 0
1 25 0 0 0
#124
pair thick leather boots~
a pair of thick leather boots~
Boots made of thick leather have been left here.~
~
9 0 0 0 0 ag 0 0 0 0 0 0 0
2 2 0 0
5 50 0 0 0
#125
bone shortsword sword~
a bone shortsword~
Made of bone, a shortsword has been left here.~
~
5 0 0 0 0 ano 0 0 0 0 0 0 0
1 6 11 0
5 50 0 0 0
#126
bone dagger~
a bone dagger~
A dagger made of bone lies here abandoned.~
~
5 0 0 0 0 ano 0 0 0 0 0 0 0
1 4 11 0
2 25 0 0 0
#127
bone longsword sword~
a bone longsword~
Long and slender, a sword lies here.~
~
5 0 0 0 0 an 0 0 0 0 0 0 0
1 8 3 0
8 100 0 0 0
#128
bone club~
a bone club~
Made of bone, a club is lying here.~
~
5 0 0 0 0 ano 0 0 0 0 0 0 0
1 4 5 0
5 50 0 0 0
#129
bone javelin~
a bone javelin~
A long, bone javelin has been left here.~
~
5 0 0 0 0 an 0 0 0 0 0 0 0
1 6 11 0
5 50 0 0 0
#130
bone spear~
a bone spear~
A long piece of bones with a sharpened edge has been left here.~
~
5 0 0 0 0 an 0 0 0 0 0 0 0
1 6 11 0
3 50 0 0 0
$~

View file

@ -29,6 +29,10 @@ D1
~
~
0 0 100
D2
~
~
0 0 136
D3
~
~
@ -555,6 +559,10 @@ Messenger's Mount~
This unfinished room was created by Kinther.
~
1 0 0 0 0 0
D0
~
~
0 0 101
D1
~
~
@ -673,8 +681,8 @@ D2
0 0 143
D3
~
~
0 0 159
door~
1 0 159
S
#145
Side Street~
@ -761,8 +769,8 @@ D1
0 0 149
D2
~
~
0 0 157
door~
1 0 157
D3
~
~
@ -793,8 +801,8 @@ D1
0 0 151
D2
~
~
0 0 156
door~
2 0 156
D3
~
~
@ -829,8 +837,8 @@ D2
0 0 155
D3
~
~
0 0 158
door~
2 0 158
S
#155
Side Street~
@ -853,8 +861,8 @@ This unfinished room was created by Kinther.
1 0 0 0 0 0
D0
~
~
0 0 152
door~
2 0 152
S
#157
A Large Domicile~
@ -863,8 +871,8 @@ This unfinished room was created by Kinther.
1 0 0 0 0 0
D0
~
~
0 0 150
door~
1 0 150
S
#158
A Small Hovel~
@ -873,8 +881,8 @@ This unfinished room was created by Kinther.
1 0 0 0 0 0
D1
~
~
0 0 154
door~
2 0 154
S
#159
A Small Hovel~
@ -883,8 +891,8 @@ This unfinished room was created by Kinther.
1 0 0 0 0 0
D1
~
~
0 0 144
door~
1 0 144
S
#160
House Inika~

View file

@ -1,7 +1,15 @@
#1
Kinther~
None.~
City of Tyr~
100 199 30 2
M 0 100 1 100 (the tall, burly human soldier)
E 1 102 1 5 (a studded leather jacket)
E 1 115 1 7 (a pair of thick leather leggings)
E 1 111 1 10 (a pair of thick leather sleeves)
E 1 108 1 6 (a bone helmet)
E 1 117 1 14 (a studded hide wrist-wrap)
E 1 118 1 3 (a padded neckguard)
E 1 117 1 15 (a studded hide wrist-wrap)
E 1 107 1 9 (a pair of leather gloves)
S
$

View file

@ -88,6 +88,8 @@ struct oasis_olc_data {
zone_rnum zone_num; /* current zone */
room_vnum number; /* vnum of subject */
int value; /* mostly 'has changed' flag*/
int dirty; /* 0/1 set to 1 when current subject has unsaved changes */
int val_slot; /* oedit: selected value[] index (0..NUM_OBJ_VAL_POSITIONS-1) */
char *storage; /* used for 'tedit' */
struct char_data *mob; /* used for 'medit' */
struct room_data *room; /* used for 'redit' */
@ -114,36 +116,38 @@ struct oasis_olc_data {
extern const char *nrm, *grn, *cyn, *yel;
/* Descriptor access macros. */
#define OLC(d) ((d)->olc)
#define OLC_MODE(d) (OLC(d)->mode) /**< Parse input mode. */
#define OLC_NUM(d) (OLC(d)->number) /**< Room/Obj VNUM. */
#define OLC_VAL(d) (OLC(d)->value) /**< Scratch variable. */
#define OLC_ZNUM(d) (OLC(d)->zone_num) /**< Real zone number. */
#define OLC(d) ((d)->olc)
#define OLC_MODE(d) (OLC(d)->mode) /**< Parse input mode. */
#define OLC_NUM(d) (OLC(d)->number) /**< Room/Obj VNUM. */
#define OLC_VAL(d) (OLC(d)->value) /**< Scratch variable. */
#define OLC_DIRTY(d) (OLC(d)->dirty) /**< True if changes made. */
#define OLC_VAL_SLOT(d) (OLC(d)->val_slot) /**< oedit: selected value[] i */
#define OLC_ZNUM(d) (OLC(d)->zone_num) /**< Real zone number. */
#define OLC_STORAGE(d) (OLC(d)->storage) /**< char pointer. */
#define OLC_ROOM(d) (OLC(d)->room) /**< Room structure. */
#define OLC_OBJ(d) (OLC(d)->obj) /**< Object structure. */
#define OLC_ZONE(d) (OLC(d)->zone) /**< Zone structure. */
#define OLC_MOB(d) (OLC(d)->mob) /**< Mob structure. */
#define OLC_SHOP(d) (OLC(d)->shop) /**< Shop structure. */
#define OLC_DESC(d) (OLC(d)->desc) /**< Extra description. */
#define OLC_CONFIG(d) (OLC(d)->config) /**< Config structure. */
#define OLC_TRIG(d) (OLC(d)->trig) /**< Trigger structure. */
#define OLC_QUEST(d) (OLC(d)->quest) /**< Quest structure */
#define OLC_MSG_LIST(d) (OLC(d)->msg) /**< Message structure */
#define OLC_STORAGE(d) (OLC(d)->storage) /**< char pointer. */
#define OLC_ROOM(d) (OLC(d)->room) /**< Room structure. */
#define OLC_OBJ(d) (OLC(d)->obj) /**< Object structure. */
#define OLC_ZONE(d) (OLC(d)->zone) /**< Zone structure. */
#define OLC_MOB(d) (OLC(d)->mob) /**< Mob structure. */
#define OLC_SHOP(d) (OLC(d)->shop) /**< Shop structure. */
#define OLC_DESC(d) (OLC(d)->desc) /**< Extra description. */
#define OLC_CONFIG(d) (OLC(d)->config) /**< Config structure. */
#define OLC_TRIG(d) (OLC(d)->trig) /**< Trigger structure. */
#define OLC_QUEST(d) (OLC(d)->quest) /**< Quest structure */
#define OLC_MSG_LIST(d) (OLC(d)->msg) /**< Message structure */
#define OLC_ACTION(d) (OLC(d)->action) /**< Action structure */
#define OLC_HELP(d) (OLC(d)->help) /**< Hedit structure */
#define OLC_PREFS(d) (OLC(d)->prefs) /**< Preferences structure */
#define OLC_IBT(d) (OLC(d)->ibt) /**< IBT (idea/bug/typo) structure */
#define OLC_ACTION(d) (OLC(d)->action) /**< Action structure */
#define OLC_HELP(d) (OLC(d)->help) /**< Hedit structure */
#define OLC_PREFS(d) (OLC(d)->prefs) /**< Preferences structure */
#define OLC_IBT(d) (OLC(d)->ibt) /**< IBT (idea/bug/typo) structure */
/* Other macros. */
#define OLC_EXIT(d) (OLC_ROOM(d)->dir_option[OLC_VAL(d)])
#define OLC_MSG(d) (OLC(d)->m_type)
#define OLC_EXIT(d) (OLC_ROOM(d)->dir_option[OLC_VAL(d)])
#define OLC_MSG(d) (OLC(d)->m_type)
/* Cleanup types. */
#define CLEANUP_ALL 1 /* Free the whole lot. */
#define CLEANUP_ALL 1 /* Free the whole lot. */
#define CLEANUP_STRUCTS 2 /* Don't free strings. */
#define CLEANUP_CONFIG 3 /* Used just to send proper message. */
#define CLEANUP_CONFIG 3 /* Used just to send proper message. */
/* Submodes of AEDIT connectedness */
#define AEDIT_CONFIRM_SAVESTRING 0
@ -172,7 +176,7 @@ extern const char *nrm, *grn, *cyn, *yel;
/* Submodes of OEDIT connectedness. */
#define OEDIT_MAIN_MENU 1
#define OEDIT_KEYWORD 2
#define OEDIT_KEYWORD 2
#define OEDIT_SHORTDESC 3
#define OEDIT_LONGDESC 4
#define OEDIT_ACTDESC 5
@ -203,49 +207,49 @@ extern const char *nrm, *grn, *cyn, *yel;
#define OEDIT_VALUE_X 30
/* Submodes of REDIT connectedness. */
#define REDIT_MAIN_MENU 1
#define REDIT_NAME 2
#define REDIT_DESC 3
#define REDIT_FLAGS 4
#define REDIT_SECTOR 5
#define REDIT_EXIT_MENU 6
#define REDIT_CONFIRM_SAVEDB 7
#define REDIT_CONFIRM_SAVESTRING 8
#define REDIT_EXIT_NUMBER 9
#define REDIT_EXIT_DESCRIPTION 10
#define REDIT_EXIT_KEYWORD 11
#define REDIT_EXIT_KEY 12
#define REDIT_EXIT_DOORFLAGS 13
#define REDIT_EXTRADESC_MENU 14
#define REDIT_EXTRADESC_KEY 15
#define REDIT_EXTRADESC_DESCRIPTION 16
#define REDIT_DELETE 17
#define REDIT_COPY 18
#define REDIT_MAIN_MENU 1
#define REDIT_NAME 2
#define REDIT_DESC 3
#define REDIT_FLAGS 4
#define REDIT_SECTOR 5
#define REDIT_EXIT_MENU 6
#define REDIT_CONFIRM_SAVEDB 7
#define REDIT_CONFIRM_SAVESTRING 8
#define REDIT_EXIT_NUMBER 9
#define REDIT_EXIT_DESCRIPTION 10
#define REDIT_EXIT_KEYWORD 11
#define REDIT_EXIT_KEY 12
#define REDIT_EXIT_DOORFLAGS 13
#define REDIT_EXTRADESC_MENU 14
#define REDIT_EXTRADESC_KEY 15
#define REDIT_EXTRADESC_DESCRIPTION 16
#define REDIT_DELETE 17
#define REDIT_COPY 18
/* Submodes of ZEDIT connectedness. */
#define ZEDIT_MAIN_MENU 0
#define ZEDIT_DELETE_ENTRY 1
#define ZEDIT_NEW_ENTRY 2
#define ZEDIT_CHANGE_ENTRY 3
#define ZEDIT_COMMAND_TYPE 4
#define ZEDIT_IF_FLAG 5
#define ZEDIT_ARG1 6
#define ZEDIT_ARG2 7
#define ZEDIT_ARG3 8
#define ZEDIT_ZONE_NAME 9
#define ZEDIT_ZONE_LIFE 10
#define ZEDIT_ZONE_BOT 11
#define ZEDIT_ZONE_TOP 12
#define ZEDIT_ZONE_RESET 13
#define ZEDIT_CONFIRM_SAVESTRING 14
#define ZEDIT_ZONE_BUILDERS 15
#define ZEDIT_SARG1 20
#define ZEDIT_SARG2 21
#define ZEDIT_ZONE_FLAGS 22
#define ZEDIT_LEVELS 23
#define ZEDIT_LEV_MIN 24
#define ZEDIT_LEV_MAX 25
#define ZEDIT_ZONE_CLAIM 26
#define ZEDIT_MAIN_MENU 0
#define ZEDIT_DELETE_ENTRY 1
#define ZEDIT_NEW_ENTRY 2
#define ZEDIT_CHANGE_ENTRY 3
#define ZEDIT_COMMAND_TYPE 4
#define ZEDIT_IF_FLAG 5
#define ZEDIT_ARG1 6
#define ZEDIT_ARG2 7
#define ZEDIT_ARG3 8
#define ZEDIT_ZONE_NAME 9
#define ZEDIT_ZONE_LIFE 10
#define ZEDIT_ZONE_BOT 11
#define ZEDIT_ZONE_TOP 12
#define ZEDIT_ZONE_RESET 13
#define ZEDIT_CONFIRM_SAVESTRING 14
#define ZEDIT_ZONE_BUILDERS 15
#define ZEDIT_SARG1 20
#define ZEDIT_SARG2 21
#define ZEDIT_ZONE_FLAGS 22
#define ZEDIT_LEVELS 23
#define ZEDIT_LEV_MIN 24
#define ZEDIT_LEV_MAX 25
#define ZEDIT_ZONE_CLAIM 26
/* Submodes of MEDIT connectedness. */
#define MEDIT_MAIN_MENU 0
@ -259,23 +263,23 @@ extern const char *nrm, *grn, *cyn, *yel;
#define MEDIT_STATS_MENU 8
/* Numerical responses. */
#define MEDIT_NUMERICAL_RESPONSE 10
#define MEDIT_SEX 11
#define MEDIT_HITROLL 12
#define MEDIT_DAMROLL 13
#define MEDIT_NDD 14
#define MEDIT_SDD 15
#define MEDIT_NUM_HP_DICE 16
#define MEDIT_SIZE_HP_DICE 17
#define MEDIT_ADD_HP 18
#define MEDIT_AC 19
#define MEDIT_EXP 20
#define MEDIT_GOLD 21
#define MEDIT_POS 22
#define MEDIT_DEFAULT_POS 23
#define MEDIT_ATTACK 24
#define MEDIT_LEVEL 25
#define MEDIT_ALIGNMENT 26
#define MEDIT_NUMERICAL_RESPONSE 10
#define MEDIT_SEX 11
#define MEDIT_HITROLL 12
#define MEDIT_DAMROLL 13
#define MEDIT_NDD 14
#define MEDIT_SDD 15
#define MEDIT_NUM_HP_DICE 16
#define MEDIT_SIZE_HP_DICE 17
#define MEDIT_ADD_HP 18
#define MEDIT_AC 19
#define MEDIT_EXP 20
#define MEDIT_GOLD 21
#define MEDIT_POS 22
#define MEDIT_DEFAULT_POS 23
#define MEDIT_ATTACK 24
#define MEDIT_LEVEL 25
#define MEDIT_ALIGNMENT 26
#define MEDIT_DELETE 27
#define MEDIT_COPY 28
#define MEDIT_STR 29
@ -292,96 +296,96 @@ extern const char *nrm, *grn, *cyn, *yel;
/* Submodes of SEDIT connectedness. */
#define SEDIT_MAIN_MENU 0
#define SEDIT_CONFIRM_SAVESTRING 1
#define SEDIT_NOITEM1 2
#define SEDIT_NOITEM2 3
#define SEDIT_NOCASH1 4
#define SEDIT_NOCASH2 5
#define SEDIT_NOBUY 6
#define SEDIT_BUY 7
#define SEDIT_SELL 8
#define SEDIT_PRODUCTS_MENU 11
#define SEDIT_ROOMS_MENU 12
#define SEDIT_NAMELIST_MENU 13
#define SEDIT_NAMELIST 14
#define SEDIT_COPY 15
#define SEDIT_CONFIRM_SAVESTRING 1
#define SEDIT_NOITEM1 2
#define SEDIT_NOITEM2 3
#define SEDIT_NOCASH1 4
#define SEDIT_NOCASH2 5
#define SEDIT_NOBUY 6
#define SEDIT_BUY 7
#define SEDIT_SELL 8
#define SEDIT_PRODUCTS_MENU 11
#define SEDIT_ROOMS_MENU 12
#define SEDIT_NAMELIST_MENU 13
#define SEDIT_NAMELIST 14
#define SEDIT_COPY 15
#define SEDIT_NUMERICAL_RESPONSE 20
#define SEDIT_OPEN1 21
#define SEDIT_OPEN2 22
#define SEDIT_CLOSE1 23
#define SEDIT_CLOSE2 24
#define SEDIT_KEEPER 25
#define SEDIT_BUY_PROFIT 26
#define SEDIT_SELL_PROFIT 27
#define SEDIT_TYPE_MENU 29
#define SEDIT_DELETE_TYPE 30
#define SEDIT_DELETE_PRODUCT 31
#define SEDIT_NEW_PRODUCT 32
#define SEDIT_DELETE_ROOM 33
#define SEDIT_NEW_ROOM 34
#define SEDIT_SHOP_FLAGS 35
#define SEDIT_NOTRADE 36
#define SEDIT_NUMERICAL_RESPONSE 20
#define SEDIT_OPEN1 21
#define SEDIT_OPEN2 22
#define SEDIT_CLOSE1 23
#define SEDIT_CLOSE2 24
#define SEDIT_KEEPER 25
#define SEDIT_BUY_PROFIT 26
#define SEDIT_SELL_PROFIT 27
#define SEDIT_TYPE_MENU 29
#define SEDIT_DELETE_TYPE 30
#define SEDIT_DELETE_PRODUCT 31
#define SEDIT_NEW_PRODUCT 32
#define SEDIT_DELETE_ROOM 33
#define SEDIT_NEW_ROOM 34
#define SEDIT_SHOP_FLAGS 35
#define SEDIT_NOTRADE 36
/* Submodes of CEDIT connectedness. */
#define CEDIT_MAIN_MENU 0
#define CEDIT_CONFIRM_SAVESTRING 1
#define CEDIT_GAME_OPTIONS_MENU 2
#define CEDIT_MAIN_MENU 0
#define CEDIT_CONFIRM_SAVESTRING 1
#define CEDIT_GAME_OPTIONS_MENU 2
#define CEDIT_CRASHSAVE_OPTIONS_MENU 3
#define CEDIT_OPERATION_OPTIONS_MENU 4
#define CEDIT_DISP_EXPERIENCE_MENU 5
#define CEDIT_ROOM_NUMBERS_MENU 6
#define CEDIT_AUTOWIZ_OPTIONS_MENU 7
#define CEDIT_OK 8
#define CEDIT_HUH 9
#define CEDIT_NOPERSON 10
#define CEDIT_NOEFFECT 11
#define CEDIT_DFLT_IP 12
#define CEDIT_DFLT_DIR 13
#define CEDIT_LOGNAME 14
#define CEDIT_MENU 15
#define CEDIT_WELC_MESSG 16
#define CEDIT_START_MESSG 17
#define CEDIT_DISP_EXPERIENCE_MENU 5
#define CEDIT_ROOM_NUMBERS_MENU 6
#define CEDIT_AUTOWIZ_OPTIONS_MENU 7
#define CEDIT_OK 8
#define CEDIT_HUH 9
#define CEDIT_NOPERSON 10
#define CEDIT_NOEFFECT 11
#define CEDIT_DFLT_IP 12
#define CEDIT_DFLT_DIR 13
#define CEDIT_LOGNAME 14
#define CEDIT_MENU 15
#define CEDIT_WELC_MESSG 16
#define CEDIT_START_MESSG 17
/* Numerical responses. */
#define CEDIT_NUMERICAL_RESPONSE 20
#define CEDIT_LEVEL_CAN_SHOUT 21
#define CEDIT_HOLLER_MOVE_COST 22
#define CEDIT_TUNNEL_SIZE 23
#define CEDIT_MAX_EXP_GAIN 24
#define CEDIT_MAX_EXP_LOSS 25
#define CEDIT_MAX_NPC_CORPSE_TIME 26
#define CEDIT_MAX_PC_CORPSE_TIME 27
#define CEDIT_IDLE_VOID 28
#define CEDIT_IDLE_RENT_TIME 29
#define CEDIT_IDLE_MAX_LEVEL 30
#define CEDIT_DTS_ARE_DUMPS 31
#define CEDIT_LOAD_INTO_INVENTORY 32
#define CEDIT_TRACK_THROUGH_DOORS 33
#define CEDIT_NO_MORT_TO_IMMORT 34
#define CEDIT_MAX_OBJ_SAVE 35
#define CEDIT_MIN_RENT_COST 36
#define CEDIT_AUTOSAVE_TIME 37
#define CEDIT_CRASH_FILE_TIMEOUT 38
#define CEDIT_RENT_FILE_TIMEOUT 39
#define CEDIT_MORTAL_START_ROOM 40
#define CEDIT_IMMORT_START_ROOM 41
#define CEDIT_FROZEN_START_ROOM 42
#define CEDIT_DONATION_ROOM_1 43
#define CEDIT_DONATION_ROOM_2 44
#define CEDIT_DONATION_ROOM_3 45
#define CEDIT_DFLT_PORT 46
#define CEDIT_MAX_PLAYING 47
#define CEDIT_MAX_FILESIZE 48
#define CEDIT_MAX_BAD_PWS 49
#define CEDIT_SITEOK_EVERYONE 50
#define CEDIT_NAMESERVER_IS_SLOW 51
#define CEDIT_USE_AUTOWIZ 52
#define CEDIT_MIN_WIZLIST_LEV 53
#define CEDIT_MAP_OPTION 54
#define CEDIT_MAP_SIZE 55
#define CEDIT_MINIMAP_SIZE 56
#define CEDIT_DEBUG_MODE 57
#define CEDIT_NUMERICAL_RESPONSE 20
#define CEDIT_LEVEL_CAN_SHOUT 21
#define CEDIT_HOLLER_MOVE_COST 22
#define CEDIT_TUNNEL_SIZE 23
#define CEDIT_MAX_EXP_GAIN 24
#define CEDIT_MAX_EXP_LOSS 25
#define CEDIT_MAX_NPC_CORPSE_TIME 26
#define CEDIT_MAX_PC_CORPSE_TIME 27
#define CEDIT_IDLE_VOID 28
#define CEDIT_IDLE_RENT_TIME 29
#define CEDIT_IDLE_MAX_LEVEL 30
#define CEDIT_DTS_ARE_DUMPS 31
#define CEDIT_LOAD_INTO_INVENTORY 32
#define CEDIT_TRACK_THROUGH_DOORS 33
#define CEDIT_NO_MORT_TO_IMMORT 34
#define CEDIT_MAX_OBJ_SAVE 35
#define CEDIT_MIN_RENT_COST 36
#define CEDIT_AUTOSAVE_TIME 37
#define CEDIT_CRASH_FILE_TIMEOUT 38
#define CEDIT_RENT_FILE_TIMEOUT 39
#define CEDIT_MORTAL_START_ROOM 40
#define CEDIT_IMMORT_START_ROOM 41
#define CEDIT_FROZEN_START_ROOM 42
#define CEDIT_DONATION_ROOM_1 43
#define CEDIT_DONATION_ROOM_2 44
#define CEDIT_DONATION_ROOM_3 45
#define CEDIT_DFLT_PORT 46
#define CEDIT_MAX_PLAYING 47
#define CEDIT_MAX_FILESIZE 48
#define CEDIT_MAX_BAD_PWS 49
#define CEDIT_SITEOK_EVERYONE 50
#define CEDIT_NAMESERVER_IS_SLOW 51
#define CEDIT_USE_AUTOWIZ 52
#define CEDIT_MIN_WIZLIST_LEV 53
#define CEDIT_MAP_OPTION 54
#define CEDIT_MAP_SIZE 55
#define CEDIT_MINIMAP_SIZE 56
#define CEDIT_DEBUG_MODE 57
/* Hedit Submodes of connectedness. */
#define HEDIT_CONFIRM_SAVESTRING 0

View file

@ -275,6 +275,8 @@ static void oedit_setup_new(struct descriptor_data *d)
OLC_OBJ(d)->short_description = strdup("an unfinished object");
SET_BIT_AR(GET_OBJ_WEAR(OLC_OBJ(d)), ITEM_WEAR_TAKE);
OLC_VAL(d) = 0;
OLC_DIRTY(d) = 0;
OLC_VAL_SLOT(d) = -1;
OLC_ITEM_TYPE(d) = OBJ_TRIGGER;
SCRIPT(OLC_OBJ(d)) = NULL;
@ -292,6 +294,8 @@ void oedit_setup_existing(struct descriptor_data *d, int real_num)
/* Attach new object to player's descriptor. */
OLC_OBJ(d) = obj;
OLC_VAL(d) = 0;
OLC_DIRTY(d) = 0;
OLC_VAL_SLOT(d) = -1;
OLC_ITEM_TYPE(d) = OBJ_TRIGGER;
dg_olc_script_copy(d);
/* The edited obj must not have a script. It will be assigned to the updated
@ -722,7 +726,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
case OEDIT_MAIN_MENU:
switch (*arg) {
case 'q': case 'Q':
if (OLC_VAL(d)) {
if (OLC_DIRTY(d)) {
write_to_output(d, "Do you wish to save your changes? : ");
OLC_MODE(d) = OEDIT_CONFIRM_SAVESTRING;
} else
@ -750,7 +754,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
}
string_write(d, &OLC_OBJ(d)->action_description,
MAX_MESSAGE_LENGTH, 0, oldtext);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
break;
case '5':
oedit_disp_type_menu(d);
@ -850,7 +854,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
if (OLC_OBJ(d)->name)
free(OLC_OBJ(d)->name);
OLC_OBJ(d)->name = str_udup(arg);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_MAIN_MENU;
oedit_disp_menu(d);
return;
@ -863,7 +867,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
if (OLC_OBJ(d)->short_description)
free(OLC_OBJ(d)->short_description);
OLC_OBJ(d)->short_description = str_udup(arg);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_MAIN_MENU;
oedit_disp_menu(d);
return;
@ -876,7 +880,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
if (OLC_OBJ(d)->description)
free(OLC_OBJ(d)->description);
OLC_OBJ(d)->description = str_udup(arg);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_MAIN_MENU;
oedit_disp_menu(d);
return;
@ -890,7 +894,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
oldtext = strdup(OLC_OBJ(d)->action_description);
}
string_write(d, &OLC_OBJ(d)->action_description, MAX_MESSAGE_LENGTH, 0, oldtext);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
return;
case OEDIT_TYPE:
@ -904,7 +908,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
for (int i = 0; i < NUM_OBJ_VAL_POSITIONS; i++)
GET_OBJ_VAL(OLC_OBJ(d), i) = 0;
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_MAIN_MENU;
oedit_disp_menu(d);
return;
@ -922,6 +926,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
} else {
/* Toggle: user picks 1..N, bit index is 0..N-1 */
TOGGLE_BIT_AR(GET_OBJ_EXTRA(OLC_OBJ(d)), (number - 1));
OLC_DIRTY(d) = 1;
oedit_disp_extra_menu(d);
return;
}
@ -939,41 +944,42 @@ void oedit_parse(struct descriptor_data *d, char *arg)
return;
} else {
TOGGLE_BIT_AR(GET_OBJ_WEAR(OLC_OBJ(d)), (number - 1));
OLC_DIRTY(d) = 1;
oedit_disp_wear_menu(d);
return;
}
case OEDIT_WEIGHT:
GET_OBJ_WEIGHT(OLC_OBJ(d)) = LIMIT(atoi(arg), 0, MAX_OBJ_WEIGHT);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_MAIN_MENU;
oedit_disp_menu(d);
return;
case OEDIT_COST:
GET_OBJ_COST(OLC_OBJ(d)) = LIMIT(atoi(arg), 0, MAX_OBJ_COST);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_MAIN_MENU;
oedit_disp_menu(d);
return;
case OEDIT_COSTPERDAY:
GET_OBJ_RENT(OLC_OBJ(d)) = LIMIT(atoi(arg), 0, MAX_OBJ_RENT);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_MAIN_MENU;
oedit_disp_menu(d);
return;
case OEDIT_TIMER:
GET_OBJ_TIMER(OLC_OBJ(d)) = LIMIT(atoi(arg), 0, MAX_OBJ_TIMER);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_MAIN_MENU;
oedit_disp_menu(d);
return;
case OEDIT_LEVEL:
GET_OBJ_LEVEL(OLC_OBJ(d)) = LIMIT(atoi(arg), 0, LVL_IMPL);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_MAIN_MENU;
oedit_disp_menu(d);
return;
@ -989,6 +995,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
if (number != AFF_CHARM) {
TOGGLE_BIT_AR(GET_OBJ_AFFECT(OLC_OBJ(d)), number);
}
OLC_DIRTY(d) = 1;
}
oedit_disp_perm_menu(d);
return;
@ -1001,7 +1008,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
} else {
int i = atoi(arg) - 1;
if (i >= 0 && i < NUM_OBJ_VAL_POSITIONS) {
OLC_VAL(d) = i;
OLC_VAL_SLOT(d) = i;
const char **labels = get_val_labels(OLC_OBJ(d));
if (GET_OBJ_TYPE(OLC_OBJ(d)) == ITEM_WEAPON && i == 2) {
@ -1042,14 +1049,14 @@ void oedit_parse(struct descriptor_data *d, char *arg)
case OEDIT_VALUE_X:
{
int i = OLC_VAL(d);
int i = OLC_VAL_SLOT(d);
int number = atoi(arg);
/* --- Armor-specific semantics --- */
if (GET_OBJ_TYPE(OLC_OBJ(d)) == ITEM_ARMOR) {
if (i == VAL_ARMOR_STEALTH_DISADV /* 3 */) {
/* clamp to 0/1 */
GET_OBJ_VAL(OLC_OBJ(d), i) = (number != 0) ? 1 : 0;
OLC_DIRTY(d) = 1;
oedit_disp_values_menu(d);
return;
}
@ -1060,6 +1067,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
return; /* stay in OEDIT_VALUE_X for a valid number */
}
GET_OBJ_VAL(OLC_OBJ(d), i) = number;
OLC_DIRTY(d) = 1;
oedit_disp_values_menu(d);
return;
}
@ -1072,6 +1080,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
return;
}
GET_OBJ_VAL(OLC_OBJ(d), i) = number;
OLC_DIRTY(d) = 1;
oedit_disp_values_menu(d);
return;
}
@ -1085,6 +1094,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
return;
}
GET_OBJ_VAL(OLC_OBJ(d), i) = number;
OLC_DIRTY(d) = 1;
oedit_disp_values_menu(d);
return;
}
@ -1096,6 +1106,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
return;
}
GET_OBJ_VAL(OLC_OBJ(d), i) = number;
OLC_DIRTY(d) = 1;
oedit_disp_values_menu(d);
return;
}
@ -1106,12 +1117,14 @@ void oedit_parse(struct descriptor_data *d, char *arg)
return;
}
TOGGLE_BIT(GET_OBJ_VAL(OLC_OBJ(d), i), 1 << number);
OLC_DIRTY(d) = 1;
oedit_disp_values_menu(d);
return;
}
/* --- Default assignment for other slots/types --- */
GET_OBJ_VAL(OLC_OBJ(d), i) = number;
OLC_DIRTY(d) = 1;
oedit_disp_values_menu(d);
return;
}
@ -1147,12 +1160,14 @@ void oedit_parse(struct descriptor_data *d, char *arg)
}
OLC_OBJ(d)->affected[OLC_VAL(d)].location = number - 1;
write_to_output(d, "Modifier : ");
OLC_DIRTY(d) = 1;
OLC_MODE(d) = OEDIT_APPLYMOD;
}
return;
case OEDIT_APPLYMOD:
OLC_OBJ(d)->affected[OLC_VAL(d)].modifier = atoi(arg);
OLC_DIRTY(d) = 1;
oedit_disp_prompt_apply_menu(d);
return;
@ -1175,6 +1190,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
REMOVE_FROM_LIST(OLC_DESC(d), OLC_OBJ(d)->ex_description, next);
free(OLC_DESC(d));
OLC_DESC(d) = NULL;
OLC_DIRTY(d) = 1;
}
break;
case 1:
@ -1190,7 +1206,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
oldtext = strdup(OLC_DESC(d)->description);
}
string_write(d, &OLC_DESC(d)->description, MAX_MESSAGE_LENGTH, 0, oldtext);
OLC_VAL(d) = 1;
OLC_DIRTY(d) = 1;
return;
case 3:
if (OLC_DESC(d)->keyword && OLC_DESC(d)->description) {
@ -1284,7 +1300,6 @@ void oedit_parse(struct descriptor_data *d, char *arg)
/* Only redisplay main menu if we are in main menu mode */
if (OLC_MODE(d) == OEDIT_MAIN_MENU) {
OLC_VAL(d) = 1;
oedit_disp_menu(d);
}
}
@ -1293,9 +1308,11 @@ void oedit_string_cleanup(struct descriptor_data *d, int terminator)
{
switch (OLC_MODE(d)) {
case OEDIT_ACTDESC:
OLC_DIRTY(d) = 1;
oedit_disp_menu(d);
break;
case OEDIT_EXTRADESC_DESCRIPTION:
OLC_DIRTY(d) = 1;
oedit_disp_extradesc_menu(d);
break;
}