I suggest you ...

MoveFloatingObjects should set self when calling found_in

(This was originally a bug report, but jesse suggested moving it here. See http://inform7.com/mantis/view.php?id=594 for original post.)

The problem is that MoveFloatingObjects is not sufficiently flexible for extensions that want to make new and better kinds of backdrop.

Way back in the I6 days, the MoveFloatingObjects routine would call "i.found_in()" to decide whether i should be in or out of the location. But in the rewrite to the template system, this was changed to:

address = i.&found_in;
m = address-->0;
if (m.call(real_location) ~= 0) ...

The difference is that the old way set "self" to i (for the duration of the call). The new way sets "self" to m -- the address of the I6 function being called. (Due to the semantics of the I6 ".()" operator.)

This is fine for I7's backdrops and doors. However, if you want to write a clever extension in which the found_in function invokes some object-related code, you're hosed, because "self" doesn't refer to the object. (I.e., you can't invoke an object-based rulebook or look up some property of the object, to decide whether the location is in or out.)

This has broken the "Conditional Backdrops by John Clemens" extension, for example.

1 vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Andrew Plotkin shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base