summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-06-24 23:39:55 +0200
committerGitHub <noreply@github.com>2017-06-24 23:39:55 +0200
commit9c186a754f19e4522c7c3a10fa56f651e8357a0b (patch)
tree5f9192850912d6abae050986a8ee38d03abed118 /modules/gdscript
parent898d8fd55735354783d131bc55c5f822ddabf60c (diff)
parent26a51c3c0b243a0c5a8317f728e256109e458956 (diff)
Merge pull request #8783 from bojidar-bg/fix-range-loop-type
Fix for..in range() resulting in floats instead of ints
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gd_parser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index d64cd86de6..75029a020b 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -2626,7 +2626,7 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
ConstantNode *cn = alloc_node<ConstantNode>();
switch (args.size()) {
- case 1: cn->value = constants[0]; break;
+ case 1: cn->value = (int)constants[0]; break;
case 2: cn->value = Vector2(constants[0], constants[1]); break;
case 3: cn->value = Vector3(constants[0], constants[1], constants[2]); break;
}
@@ -2639,7 +2639,7 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
on->arguments.push_back(tn);
switch (args.size()) {
- case 1: tn->vtype = Variant::REAL; break;
+ case 1: tn->vtype = Variant::INT; break;
case 2: tn->vtype = Variant::VECTOR2; break;
case 3: tn->vtype = Variant::VECTOR3; break;
}