1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

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:
lawnjelly
2022-01-19 19:46:17 +00:00
parent 249c60e9d1
commit b411a731fe
18 changed files with 35 additions and 23 deletions

View File

@@ -382,7 +382,7 @@ AABB ImmediateMesh::get_aabb() const {
if (i == 0) {
aabb = surfaces[i].aabb;
} else {
aabb.merge(surfaces[i].aabb);
aabb = aabb.merge(surfaces[i].aabb);
}
}
return aabb;