Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/framework/components/script/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ class ScriptComponentSystem extends ComponentSystem {
}

for (const key in entity.script._scriptsIndex) {
if (key.awaiting) {
order.splice(key.ind, 0, key);
const scriptEntry = entity.script._scriptsIndex[key];
if (scriptEntry.awaiting) {
order.splice(scriptEntry.ind, 0, key);
Comment on lines +124 to +126
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix correctly handles awaiting scripts during cloning, but there is no test coverage for this scenario. Consider adding a test that verifies cloning an entity with a ScriptComponent that has scripts in the "awaiting" state (i.e., scripts that are referenced but not yet registered). This would ensure the fix works as intended and prevent future regressions.

Copilot uses AI. Check for mistakes.
}
}

Expand Down