Skip to content

Commit a266c63

Browse files
committed
error checking in API-entry tasks
1 parent 0f630f3 commit a266c63

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

scripts/dmodels_animating.dsc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ dmodels_end_animation:
99
debug: false
1010
definitions: root_entity
1111
script:
12+
- if !<[root_entity].is_truthy> || !<[root_entity].has_flag[dmodel_model_id]||false>:
13+
- debug error "[DModels] invalid end_animation root_entity <[root_entity]>"
14+
- stop
1215
- flag <[root_entity]> dmodels_animation_id:!
1316
- flag <[root_entity]> dmodels_anim_time:0
1417
- flag server dmodels_anim_active.<[root_entity].uuid>:!
@@ -19,6 +22,9 @@ dmodels_animate:
1922
debug: false
2023
definitions: root_entity|animation
2124
script:
25+
- if !<[root_entity].is_truthy> || !<[root_entity].has_flag[dmodel_model_id]||false>:
26+
- debug error "[DModels] invalid animate root_entity <[root_entity]>"
27+
- stop
2228
- run dmodels_reset_model_position def.root_entity:<[root_entity]>
2329
- define animation_data <server.flag[dmodels_data.animations_<[root_entity].flag[dmodel_model_id]>.<[animation]>]||null>
2430
- if <[animation_data]> == null:

scripts/dmodels_command.dsc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ dmodels_command:
8080
- if !<[spawned].is_truthy>:
8181
- narrate "<&[error]>Spawning failed?"
8282
- stop
83-
- flag player spawned_model_<[model]>:<[spawned]>
83+
- flag player spawned_dmodel_<[model]>:<[spawned]>
8484
- narrate "<&[base]>Spawned model <[model].custom_color[emphasis]> with root entity <[spawned].uuid.custom_color[emphasis]>, stored to player flag '<&[emphasis]>spawned_dmodel_<[model]><&[base]>'"
8585
- case remove:
8686
- if !<player.has_permission[dmodels.remove]>:

scripts/dmodels_spawning.dsc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ dmodels_delete:
7575
debug: false
7676
definitions: root_entity
7777
script:
78+
- if !<[root_entity].is_truthy> || !<[root_entity].has_flag[dmodel_model_id]||false>:
79+
- debug error "[DModels] invalid delete root_entity <[root_entity]>"
80+
- stop
81+
- flag server dmodels_anim_active.<[root_entity].uuid>:!
82+
- flag server dmodels_attached.<[root_entity].uuid>:!
7883
- remove <[root_entity].flag[dmodel_parts]>
7984
- remove <[root_entity]>
8085

0 commit comments

Comments
 (0)