mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Check for type mismatch in PropertyTweener.from()
(cherry picked from commit 45f4d59fa4
)
This commit is contained in:
parent
925381201b
commit
4e90cc55ec
2 changed files with 7 additions and 0 deletions
|
@ -489,6 +489,11 @@ Tween::Tween(bool p_valid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<PropertyTweener> PropertyTweener::from(Variant p_value) {
|
Ref<PropertyTweener> PropertyTweener::from(Variant p_value) {
|
||||||
|
ERR_FAIL_COND_V(tween.is_null(), nullptr);
|
||||||
|
if (!tween->_validate_type_match(p_value, final_val)) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
initial_val = p_value;
|
initial_val = p_value;
|
||||||
do_continue = false;
|
do_continue = false;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -61,6 +61,8 @@ class MethodTweener;
|
||||||
class Tween : public RefCounted {
|
class Tween : public RefCounted {
|
||||||
GDCLASS(Tween, RefCounted);
|
GDCLASS(Tween, RefCounted);
|
||||||
|
|
||||||
|
friend class PropertyTweener;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum TweenProcessMode {
|
enum TweenProcessMode {
|
||||||
TWEEN_PROCESS_PHYSICS,
|
TWEEN_PROCESS_PHYSICS,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue