Closed curiousdannii-testing closed 2 years ago
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by zarf :
Confirmed.
The TestRegionalContainment() routine has no logic to support the case where obj is a region. It reaches the line
if (~~(obj ofclass K1_room)) obj = LocationOf(obj);
...and LocationOf() always returns "nothing" for regions. Thus the test always returns false.
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by zarf :
I thought this might have been fallout from http://inform7.com/mantis/view.php?id=1501 in 6L38. Nope – while TestRegionalContainment changed in that fix, this example failed before that.
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by zarf :
Quick cut at a fix:
[ TestRegionalContainment obj region o;
if ((obj == nothing) || (region == nothing)) rfalse;
if (obj ofclass K7_backdrop or K4_door){ if (obj has absent) rfalse; objectloop (o ofclass K1_room) if (TestRegionalContainment(o, region)) if (BackdropLocation(obj, o)) rtrue; rfalse; }
if (obj ofclass K9_region)
{ o = obj; }
else
{ if (~~(obj ofclass K1_room)) obj = LocationOf(obj); if (obj == nothing) rfalse; o = obj.map_region; }
while (o)
{ if (o == region) rtrue; o = parent(o); }
rfalse;
];
Reported by : dfremont
Description :
WI 6.11 states that regional-containment allows regions to be "in" regions, but testing the relation between two regions always fails (see the example below). This occurs regardless of how the test is done, using the verbs "in" or "regionally in", or with "R relates X to Y".
The Index does correctly mention one region as being in the other (as long as the inner region contains a room).
Steps to reproduce :
Additional information :
imported from: [Mantis 1982] Regional-containment doesn't relate regions correctly