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:
@ -1017,8 +1017,8 @@ void CanvasItem::set_notify_transform(bool p_enable) {
|
||||
notify_transform = p_enable;
|
||||
|
||||
if (notify_transform && is_inside_tree()) {
|
||||
//this ensures that invalid globals get resolved, so notifications can be received
|
||||
get_global_transform();
|
||||
// This ensures that invalid globals get resolved, so notifications can be received.
|
||||
_ALLOW_DISCARD_ get_global_transform();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user