Add nodiscard to core math classes to catch c++ errors.
A common source of errors is to call functions (such as round()) expecting them to work in place, but them actually being designed only to return the processed value. Not using the return value in this case in indicative of a bug, and can be flagged as a warning by using the [[nodiscard]] attribute.
This commit is contained in:
parent
249c60e9d1
commit
b411a731fe
18 changed files with 35 additions and 23 deletions
|
|
@ -1776,7 +1776,8 @@ void ResourceImporterScene::_optimize_track_usage(AnimationPlayer *p_player, Ani
|
|||
if (bone_idx == -1) {
|
||||
continue;
|
||||
}
|
||||
skel->get_bone_pose(bone_idx);
|
||||
// Note that this is using get_bone_pose to update the bone pose cache.
|
||||
_ALLOW_DISCARD_ skel->get_bone_pose(bone_idx);
|
||||
loc = skel->get_bone_pose_position(bone_idx);
|
||||
rot = skel->get_bone_pose_rotation(bone_idx);
|
||||
scale = skel->get_bone_pose_scale(bone_idx);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue