bug: "addObject" function doesn't seem to do anything #102

Open
opened 2023-12-21 12:17:21 +08:00 by ArcanoxDragon · 0 comments
ArcanoxDragon commented 2023-12-21 12:17:21 +08:00 (Migrated from github.com)

Describe the bug

Calling the addObject function with a directory path doesn't seem to do anything at all - custom object modules are not required.

It looks like all this function does is add the provided path to newObjects in main.lua, but newObjects is only ever visted when main.lua is first evaluated (i.e. when the module is required, before the addObject function can even be called).

To Reproduce

Steps to reproduce the behavior:

  1. Add a custom object module to a folder that has a debug print or something at the top
  2. Pass the folder to basalt.addObject("...") in a test program
  3. Run the program and observe that the custom modules are not imported

Expected behavior

The custom object modules would be imported and registered as object types in Basalt.

Checklist

  • I am running the latest version.
**Describe the bug** Calling the `addObject` function with a directory path doesn't seem to do anything at all - custom object modules are not required. It looks like all this function does is add the provided path to `newObjects` in `main.lua`, but `newObjects` is only ever visted when `main.lua` is first evaluated (i.e. when the module is `require`d, before the `addObject` function can even be called). **To Reproduce** Steps to reproduce the behavior: 1. Add a custom object module to a folder that has a debug print or something at the top 2. Pass the folder to `basalt.addObject("...")` in a test program 3. Run the program and observe that the custom modules are not imported **Expected behavior** The custom object modules would be imported and registered as object types in Basalt. **Checklist** - [x] I am running the latest version.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GitHub/Basalt#102
No description provided.