Skip to content

Commit

Permalink
added new functions for getting the bone data
Browse files Browse the repository at this point in the history
  • Loading branch information
katsaii committed Nov 3, 2021
1 parent ebb78ec commit 034db81
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/scr_disarm/scr_disarm.gml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,30 @@ function disarm_object_get_data(_arm, _info) {
return entity.info[pos];
}

/// @desc Returns whether a bone exists with this name.
/// @param {struct} arm The Disarm instance to update.
/// @param {real} bone_name_or_id The name of the object to check.
function disarm_bone_exists(_arm, _bone) {
if (disarm_object_exists(_arm, _bone)) {
return disarm_object_get_data(_arm, _bone).type == "bone";
} else {
return false;
}
}

/// @desc Returns a reference to the bone data with this name. Note: any changes made to this
/// struct will affect the representation of the object in the animation.
/// @param {struct} arm The Disarm instance to update.
/// @param {real} bone_name_or_id The name of the object to get.
function disarm_bone_get_data(_arm, _bone) {
var info = disarm_object_get_data(_arm, _bone);
if (info.type == "bone") {
return info;
} else {
return undefined;
}
}

/// @desc Returns whether a slot exists with this name.
/// @param {struct} arm The Disarm instance to update.
/// @param {real} slot_name_or_id The name of the slot to check.
Expand Down

0 comments on commit 034db81

Please sign in to comment.