summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-10-14 11:40:55 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-10-14 11:40:55 +0200
commit616ab4fac200170bc0d2ba1958e424fd309fc494 (patch)
treeb39dcd6dfe36cc5c99ce7f8790631ac242b1217e /scene
parent1fed266bf5452b30376db62495f4985f6975f2c1 (diff)
Small fixes to redundand code, copy paste bugs
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/sprite_3d.cpp3
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/main/scene_tree.cpp5
-rw-r--r--scene/resources/bit_map.cpp2
4 files changed, 5 insertions, 7 deletions
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index aec672d2c7..a8d2f4d415 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -577,9 +577,8 @@ void Sprite3D::set_frame(int p_frame) {
ERR_FAIL_INDEX(p_frame, int64_t(vframes) * hframes);
- if (frame != p_frame)
+ frame = p_frame;
- frame = p_frame;
_queue_update();
_change_notify("frame");
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index a22ddb265b..5f9b913e8c 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -5915,7 +5915,7 @@ void TextEdit::unfold_line(int p_line) {
if (!is_folded(p_line) && !is_line_hidden(p_line))
return;
- int fold_start = p_line;
+ int fold_start;
for (fold_start = p_line; fold_start > 0; fold_start--) {
if (is_folded(fold_start))
break;
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 3ee21ce38b..830d314245 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -70,9 +70,8 @@ float SceneTreeTimer::get_time_left() const {
}
void SceneTreeTimer::set_pause_mode_process(bool p_pause_mode_process) {
- if (process_pause != p_pause_mode_process) {
- process_pause = p_pause_mode_process;
- }
+
+ process_pause = p_pause_mode_process;
}
bool SceneTreeTimer::is_pause_mode_process() {
diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp
index b5354bc3e2..e6139dd707 100644
--- a/scene/resources/bit_map.cpp
+++ b/scene/resources/bit_map.cpp
@@ -534,7 +534,7 @@ void BitMap::grow_mask(int p_pixels, const Rect2 &p_rect) {
return;
}
- bool bit_value = (p_pixels > 0) ? true : false;
+ bool bit_value = p_pixels > 0;
p_pixels = Math::abs(p_pixels);
Rect2i r = Rect2i(0, 0, width, height).clip(p_rect);