Skip to content

Mudlet package behaving as though things are there which should not be. Module does not do this. #6460

@demonnic

Description

@demonnic

Brief summary of issue / Description of requested feature:

While helping mccarp look over her PR to the IRE mapping script we discovered some strange behavior out of Mudlet. If you install the xml as a module, it will error every time due to trying to add a function to the mmp table before it exists in the "Create Option Table" script, which will show up as a ladybug in the editor, like so:

image

But, if you install it as a package, it will be a ladybug initially, but when you restart mudlet or close and reopen the profile, it will no longer be a ladybug, and the package will work as though everything was setup correctly. However, if you do a resetProfile() the error returns in the full package.

image

I have attached 2 zipped xml files. One is a minimal example showing the ladybug/not-ladybug state of "Create Option Table" without the rest of the package as noise. The second one is the full package the issues were noted in, which has the benefit of actually throwing an error on load.

Steps to reproduce the issue / Reasons for adding feature:

  1. Download either zip file
  2. unzip xml from it
  3. install as package, and see the ladybug on "Create Option Table"
  4. close and reopen profile, observe there is no ladybug
  5. If you used the full xml file, try lua resetProfile() and see the error
  6. uninstall package, reinstall as module
  7. Restart profile
  8. Notice it is now ladybug every time, until you click on it with the mmp table already defined (which happens in the next script object in both package)
  9. if the full package, it will also throw the attempt to index field 'settings' (a nil value) error every time you open the profile

Error output / Expected result of feature

Extra information, such as the Mudlet version, operating system and ideas for how to solve / implement:

The two test files are attached below. I'm stumped as to the underlying reason behind this, but all I can figure is it must be due to the way packages are injected to the profile xml and modules are not, and this is somehow causing it to see things which shouldn't be there? The minimal version doesn't prove much except it wasn't something else in the package causing it to act wonky, but the full version actually works when installed as a package, which should definitely not be the case.

Minimal version of the package to show the ladybug (or not)
mudlet-mapper.zip

Full version of the package, which will also error in addition to showing the ladybug in the editor
mudlet-mapper - Copy.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions