fix(工作台): 脚本保存补world_id(NOT NULL约束)——实体/场景级脚本归属游戏世界
This commit is contained in:
parent
e6ed58c3d9
commit
4222635822
@ -140,7 +140,8 @@
|
|||||||
var s = state.sel;
|
var s = state.sel;
|
||||||
if (!s) return null;
|
if (!s) return null;
|
||||||
var p = {game_id: state.game.id, trigger_event: document.getElementById('event_sel').value};
|
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 === 'scene') p.scene_id = s.id;
|
||||||
if (s.type === 'entity') p.entity_id = s.id;
|
if (s.type === 'entity') p.entity_id = s.id;
|
||||||
return p;
|
return p;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user