From 4222635822ddfcd5dff7f4421860ce6dbc65124a Mon Sep 17 00:00:00 2001 From: pipeline-agent Date: Sun, 30 Aug 2026 15:36:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=BF=9D=E5=AD=98=E8=A1=A5world=5Fid(NOT=20NULL?= =?UTF-8?q?=E7=BA=A6=E6=9D=9F)=E2=80=94=E2=80=94=E5=AE=9E=E4=BD=93/?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E7=BA=A7=E8=84=9A=E6=9C=AC=E5=BD=92=E5=B1=9E?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E4=B8=96=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/workbench/workbench.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wwwroot/workbench/workbench.js b/wwwroot/workbench/workbench.js index c537f24..c48eff1 100644 --- a/wwwroot/workbench/workbench.js +++ b/wwwroot/workbench/workbench.js @@ -140,7 +140,8 @@ var s = state.sel; if (!s) return null; var p = {game_id: state.game.id, trigger_event: document.getElementById('event_sel').value}; - if (s.type === 'world') p.world_id = s.id; + // 世界外键:所有级别脚本都归属该游戏的世界(world_id NOT NULL 约束) + if (state.data && state.data.world) p.world_id = state.data.world.id; if (s.type === 'scene') p.scene_id = s.id; if (s.type === 'entity') p.entity_id = s.id; return p;