Skip to content

Commit bfd8dea

Browse files
committed
Fix unidentified item name
Closes #86
1 parent d38abb7 commit bfd8dea

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/game/object.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4049,6 +4049,18 @@ void object_examine(int64_t obj, int64_t pc_obj, char* buffer)
40494049
return;
40504050
}
40514051

4052+
// Special case for items - unidentified item name is stored in a separate
4053+
// field.
4054+
if (obj_type_is_item(type)
4055+
&& !object_editor
4056+
&& !item_is_identified(obj)) {
4057+
name = description_get(obj_field_int32_get(obj, OBJ_F_ITEM_DESCRIPTION_UNKNOWN));
4058+
if (name != NULL) {
4059+
strcpy(buffer, name);
4060+
}
4061+
return;
4062+
}
4063+
40524064
// Special case for PC - name is stored in a specific object field.
40534065
if (type == OBJ_TYPE_PC) {
40544066
char* player_name;

0 commit comments

Comments
 (0)