1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

fix six possible "divide by zero"

This commit is contained in:
Hubert Jarosz
2016-03-01 00:08:33 +01:00
committed by Hubert Jarosz
parent bf7f9244a9
commit 7b07bcaf44
6 changed files with 23 additions and 15 deletions

View File

@@ -2084,7 +2084,9 @@ void SpatialEditorViewport::_menu_option(int p_option) {
count++;
}
center/=float(count);
if( count != 0 ) {
center/=float(count);
}
cursor.pos=center;
} break;
@@ -4240,6 +4242,3 @@ SpatialEditorPlugin::SpatialEditorPlugin(EditorNode *p_node) {
SpatialEditorPlugin::~SpatialEditorPlugin() {
}