curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-2046] [Mantis 2083] Containers holding concealed items do not show the " (empty)" detail text. #38

Open curiousdannii-testing opened 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : Eleas

Description :

Self-explanatory. What's happening here is that the WriteAfterEntry routine uses child() to determine whether to write "(open)" or not for an open or transparent container. For container with only concealed items, the message is suppressed, but the routine then correctly refuses to write a contents list, so the end result is nothing gets printed.

Steps to reproduce :

Home is a room.
The foo and the bar are containers in Home.
The baz is in the bar.

For deciding the concealed possessions of a container: if the particular possession is the baz, yes.

Additional information :

Proposed fix: there's a visible-child check in WriteAfterEntry already. Simply moving it to before the start of the activity gives us the child_count, which can then substitute for the child() check:

[ WriteAfterEntry o depth
p recurse_flag parenth_flag eldest_child child_count combo;

inventory_stage = 2;
child_count = 0;
eldest_child = nothing;
objectloop (p in o)
if ((c_style & CONCEAL_BIT == 0) || (ConcealedFromLists(p) == false))
if (p has list_filter_permits)

{ child_count++; if (eldest_child == nothing) eldest_child = p; }

if (c_style & PARTINV_BIT) {
BeginActivity(PRINTING_ROOM_DESC_DETAILS_ACT, o);
if (ForActivity(PRINTING_ROOM_DESC_DETAILS_ACT, o) == false) {
combo = 0;
if (o has light && location hasnt light) combo=combo+1;
if (o has container && o hasnt open) combo=combo+2;
if ((o has container && (o has open || o has transparent))) {
if (child_count==0)

{ combo=combo+4; }

}
if (combo) LIST_WRITER_INTERNAL_RM('A'); ! space and open bracket
switch (combo)

{ 1: LIST_WRITER_INTERNAL_RM('D', o); 2: LIST_WRITER_INTERNAL_RM('E', o); 3: LIST_WRITER_INTERNAL_RM('H', o); 4: LIST_WRITER_INTERNAL_RM('F', o); 5: LIST_WRITER_INTERNAL_RM('I', o); 6: LIST_WRITER_INTERNAL_RM('G', o); 7: LIST_WRITER_INTERNAL_RM('J', o); }

if (combo) LIST_WRITER_INTERNAL_RM('B'); ! close bracket
}
EndActivity(PRINTING_ROOM_DESC_DETAILS_ACT, o);
} ! end of PARTINV_BIT processing
if (c_style & FULLINV_BIT) {
BeginActivity(PRINTING_INVENTORY_DETAILS_ACT, o);
if (ForActivity(PRINTING_INVENTORY_DETAILS_ACT, o) == false) {
if (o has light && o has worn)

{ LIST_WRITER_INTERNAL_RM('A'); LIST_WRITER_INTERNAL_RM('K', o); parenth_flag = true; }

else {
if (o has light)

{ LIST_WRITER_INTERNAL_RM('A'); LIST_WRITER_INTERNAL_RM('D', o); parenth_flag = true; }

if (o has worn)

{ LIST_WRITER_INTERNAL_RM('A'); LIST_WRITER_INTERNAL_RM('L', o); parenth_flag = true; }

}
if (o has container)
if (o has openable) {
if (parenth_flag)

{

Ifdef SERIAL_COMMA; print ","; #Endif;

                    LIST_WRITER_INTERNAL_RM('C');
                }

else LIST_WRITER_INTERNAL_RM('A', o);
if (o has open)
if (child(o)) LIST_WRITER_INTERNAL_RM('M', o);
else LIST_WRITER_INTERNAL_RM('N', o);
else
if (o has lockable && o has locked) LIST_WRITER_INTERNAL_RM('P', o);
elseLIST_WRITER_INTERNAL_RM('O', o);
parenth_flag = true;
}
else
if (child(o)==0 && o has transparent)
if (parenth_flag)

{ LIST_WRITER_INTERNAL_RM('C'); LIST_WRITER_INTERNAL_RM('F'); }

else

{ LIST_WRITER_INTERNAL_RM('A'); LIST_WRITER_INTERNAL_RM('F'); LIST_WRITER_INTERNAL_RM('B'); }

if (parenth_flag) LIST_WRITER_INTERNAL_RM('B');
}
EndActivity(PRINTING_INVENTORY_DETAILS_ACT, o);
} ! end of FULLINV_BIT processing

if (child_count && (c_style & ALWAYS_BIT)) {
if (c_style & ENGLISH_BIT)

{ print " "; LIST_WRITER_INTERNAL_RM('Q', o); print " "; }

recurse_flag = true;
}

if (child_count && (c_style & RECURSE_BIT)) {
if (o has supporter) {
if (c_style & ENGLISH_BIT) {
if (c_style & TERSE_BIT)

{ LIST_WRITER_INTERNAL_RM('A', o); LIST_WRITER_INTERNAL_RM('R', o); }

else LIST_WRITER_INTERNAL_RM('S', o);
}
recurse_flag = true;
}
if (o has container && (o has open || o has transparent)) {
if (c_style & ENGLISH_BIT) {
if (c_style & TERSE_BIT)

{ LIST_WRITER_INTERNAL_RM('A', o); LIST_WRITER_INTERNAL_RM('T', o); }

else LIST_WRITER_INTERNAL_RM('U', o);
}
recurse_flag = true;
}
}

if (recurse_flag && (c_style & ENGLISH_BIT))

{ SetLWI(child_count, -1, eldest_child); LIST_WRITER_INTERNAL_RM('V', o); print " "; }

if (c_style & NEWLINE_BIT) new_line;

if (recurse_flag)

{ o = child(o); @push lt_value; @push listing_together; @push listing_size; @push c_iterator; c_iterator = ObjectTreeIterator; lt_value = EMPTY_TEXT_VALUE; listing_together = 0; listing_size = 0; WriteListR(o, depth+1, true); @pull c_iterator; @pull listing_size; @pull listing_together; @pull lt_value; if (c_style & TERSE_BIT) LIST_WRITER_INTERNAL_RM('B'); }

];

imported from: [Mantis 2083] Containers holding concealed items do not show the " (empty)" detail text.
  • status: Reported
  • resolution: Open
  • resolved: 2022-04-07T05:02:45+10:00
  • imported: 2022/01/10
curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by zarf :
Probably can be dealt with at the same time as http://inform7.com/mantis/view.php?id=2073 .