The issue is part of the definition of the default action routine for ##PutOn
, called PutOnSub
:
! StdLib 6.12 but also affects 6/11
[ PutOnSub ancestor;
receive_action = ##PutOn;
if (second == d_obj || actor in second) <<Drop noun, actor>>;
if (parent(noun) == second) return L__M(##Drop, 1, noun);
if (noun notin actor && ImplicitTake(noun)) return L__M(##PutOn, 1, noun);
ancestor = CommonAncestor(noun, second);
if (ancestor == noun) return L__M(##PutOn, 2, noun);
if (ObjectIsUntouchable(second)) return;
if (second ~= ancestor) {
action = ##Receive;
if (RunRoutines(second, before)) { action = ##PutOn; return; }
action = ##PutOn;
}
if (second hasnt supporter) return L__M(##PutOn, 3, second);
if (ancestor == actor) return L__M(##PutOn, 4, second); ! <--- PROBLEM LINE
if (noun has worn && ImplicitDisrobe(noun)) return;
if (ObjectDoesNotFit(noun, second) ||
LibraryExtensions.RunWhile(ext_objectdoesnotfit, false, noun, second)) return;
if (AtFullCapacity(noun, second)) return L__M(##PutOn, 6, second);
move noun to second;
if (AfterRoutines()) return;
if (second ~= ancestor) {
action = ##Receive;
if (RunRoutines(second, after)) { action = ##PutOn; return; }
action = ##PutOn;
}
if (keep_silent) return;
if (multiflag) return L__M(##PutOn, 7);
L__M(##PutOn, 8, noun, second);
];
I’m not certain what the intent of the original logic is, but it forbids putting any item in inventory on top of another item in inventory, as you are seeing.
If you want to allow this behavior in all situations, you can just replace the routine definition using the Replace
directive and remove that line (which may cause other problems), or you can modify it (as in the following example).
Constant Story "Ham Sandwich";
Constant Headline "^an intfiction.org help forum problem^";
Replace PutOnSub;
Include "Parser";
Include "VerbLib";
[ PutOnSub ancestor;
receive_action = ##PutOn;
if (second == d_obj || actor in second) <<Drop noun, actor>>;
if (parent(noun) == second) return L__M(##Drop, 1, noun);
if (noun notin actor && ImplicitTake(noun)) return L__M(##PutOn, 1, noun);
ancestor = CommonAncestor(noun, second);
if (ancestor == noun) return L__M(##PutOn, 2, noun);
if (ObjectIsUntouchable(second)) return;
if (second ~= ancestor) {
action = ##Receive;
if (RunRoutines(second, before)) { action = ##PutOn; return; }
action = ##PutOn;
}
if (second hasnt supporter) return L__M(##PutOn, 3, second);
if (noun == actor || second == actor) return L__M(##PutOn, 4, second); ! MODIFIED
if (noun has worn && ImplicitDisrobe(noun)) return;
if (ObjectDoesNotFit(noun, second) ||
LibraryExtensions.RunWhile(ext_objectdoesnotfit, false, noun, second)) return;
if (AtFullCapacity(noun, second)) return L__M(##PutOn, 6, second);
move noun to second;
if (AfterRoutines()) return;
if (second ~= ancestor) {
action = ##Receive;
if (RunRoutines(second, after)) { action = ##PutOn; return; }
action = ##PutOn;
}
if (keep_silent) return;
if (multiflag) return L__M(##PutOn, 7);
L__M(##PutOn, 8, noun, second);
];
Include "Grammar";
Class Room
has light;
Room Start "Starting Point"
with description
"An uninteresting room.";
Object ham_slice "slice of ham" Start
with name 'slice' 'ham'
has edible;
Object bread_slice "slice of bread" Start
with name 'slice' 'bread'
has edible supporter;
[ Initialise ;
location = Start;
];