mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
GDScript: Add missing type conversions in for range
This commit is contained in:
parent
51b0379e55
commit
e2d4469dc2
4 changed files with 35 additions and 5 deletions
|
|
@ -1585,9 +1585,21 @@ void GDScriptByteCodeGenerator::write_for_range_assignment(const Address &p_from
|
|||
const Address &range_step = for_range_step_variables.back()->get();
|
||||
|
||||
// Assign range args.
|
||||
write_assign(range_from, p_from);
|
||||
write_assign(range_to, p_to);
|
||||
write_assign(range_step, p_step);
|
||||
if (range_from.type == p_from.type) {
|
||||
write_assign(range_from, p_from);
|
||||
} else {
|
||||
write_assign_with_conversion(range_from, p_from);
|
||||
}
|
||||
if (range_to.type == p_to.type) {
|
||||
write_assign(range_to, p_to);
|
||||
} else {
|
||||
write_assign_with_conversion(range_to, p_to);
|
||||
}
|
||||
if (range_step.type == p_step.type) {
|
||||
write_assign(range_step, p_step);
|
||||
} else {
|
||||
write_assign_with_conversion(range_step, p_step);
|
||||
}
|
||||
}
|
||||
|
||||
void GDScriptByteCodeGenerator::write_for(const Address &p_variable, bool p_use_conversion, bool p_is_range) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue