From fdaa2920eb21fff3320a17e9239e04dfadecdb00 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 14:38:54 -0300 Subject: Updated copyright year in all headers --- modules/gdscript/gd_compiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gdscript/gd_compiler.cpp') diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 278651d64..d19a88108 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3-70-g09d2 From 4661a6e126f03efcb7b41196d2fca9c9564123c6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 16:17:33 -0300 Subject: -try to avoid errors when path using ".." is present in script include, fixes #1703 --- core/allocators.h | 2 +- core/balloon_allocator.h | 2 +- core/math/vector3.cpp | 2 +- core/math/vector3.h | 2 +- modules/gdscript/gd_compiler.cpp | 2 +- scene/2d/tile_map.cpp | 9 ++++----- scene/2d/tile_map.h | 2 +- scene/gui/text_edit.cpp | 10 ---------- servers/physics_server.cpp | 2 +- servers/physics_server.h | 2 +- servers/visual/visual_server_raster.cpp | 2 +- servers/visual/visual_server_raster.h | 2 +- 12 files changed, 14 insertions(+), 25 deletions(-) (limited to 'modules/gdscript/gd_compiler.cpp') diff --git a/core/allocators.h b/core/allocators.h index 42eb4effa..16e516e87 100644 --- a/core/allocators.h +++ b/core/allocators.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/balloon_allocator.h b/core/balloon_allocator.h index d99f805f5..177c74466 100644 --- a/core/balloon_allocator.h +++ b/core/balloon_allocator.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index 0928a09b2..a3877eb9f 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/vector3.h b/core/math/vector3.h index d2f240882..d27b61137 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index d19a88108..dbe5f2833 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -1386,7 +1386,7 @@ Error GDCompiler::_parse_class(GDScript *p_script,GDScript *p_owner,const GDPars _set_error("Could not resolve relative path for parent class: "+path,p_class); return ERR_FILE_NOT_FOUND; } - path=base.get_base_dir().plus_file(path); + path=base.get_base_dir().plus_file(path).simplify_path(); } script = ResourceLoader::load(path); if (script.is_null()) { diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index bc2dfe101..bf1677ae6 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -348,8 +348,8 @@ void TileMap::_update_dirty_quadrants() { rect.pos=offset.floor(); rect.size=s; - rect.size.x+=fp_adjust; - rect.size.y+=fp_adjust; + /* rect.size.x+=fp_adjust; + rect.size.y+=fp_adjust;*/ if (c.flip_h) rect.size.x=-rect.size.x; @@ -1154,8 +1154,7 @@ TileMap::TileMap() { navigation=NULL; y_sort_mode=false; - fp_adjust=0.01; - fp_adjust=0.01; + fp_adjust=0.00001; tile_origin=TILE_ORIGIN_TOP_LEFT; } diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 976ddfc5c..233529f01 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 0fa64f9b2..fb939d19b 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -26,16 +26,6 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -/*****f********************************************/ -/* text_edit.cpp */ -/*************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/*************************************************/ -/* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ -/* All Rights Reserved. */ -/*************************************************/ #include "text_edit.h" #include "os/keyboard.h" diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp index 79de253d3..a5c7d3549 100644 --- a/servers/physics_server.cpp +++ b/servers/physics_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_server.h b/servers/physics_server.h index 0c2542a66..97a1d34e7 100644 --- a/servers/physics_server.h +++ b/servers/physics_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 5aca15958..eaa02df51 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 5587af23d..f3b94b73d 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3-70-g09d2 From 701335e845166acb2a386778a70476ee57f33919 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 17:55:04 -0300 Subject: -Throw error if setter and getter reference their member variable with self. , fixes #1685 --- modules/gdscript/gd_compiler.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'modules/gdscript/gd_compiler.cpp') diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index dbe5f2833..b405555ec 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -559,7 +559,17 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre int index; if (named) { +#ifdef DEBUG_ENABLED + if (on->arguments[0]->type==GDParser::Node::TYPE_SELF && codegen.script && codegen.function_node && !codegen.function_node->_static) { + const Map::Element *MI = codegen.script->member_indices.find(static_cast(on->arguments[1])->name); + if (MI && MI->get().getter==codegen.function_node->name) { + String n = static_cast(on->arguments[1])->name; + _set_error("Must use '"+n+"' instead of 'self."+n+"' in getter.",on); + return -1; + } + } +#endif index=codegen.get_name_map_pos(static_cast(on->arguments[1])->name); } else { @@ -703,6 +713,25 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre if (on->arguments[0]->type==GDParser::Node::TYPE_OPERATOR && (static_cast(on->arguments[0])->op==GDParser::OperatorNode::OP_INDEX || static_cast(on->arguments[0])->op==GDParser::OperatorNode::OP_INDEX_NAMED)) { //SET (chained) MODE!! + +#ifdef DEBUG_ENABLED + if (static_cast(on->arguments[0])->op==GDParser::OperatorNode::OP_INDEX_NAMED) { + const GDParser::OperatorNode* inon = static_cast(on->arguments[0]); + + + if (inon->arguments[0]->type==GDParser::Node::TYPE_SELF && codegen.script && codegen.function_node && !codegen.function_node->_static) { + + const Map::Element *MI = codegen.script->member_indices.find(static_cast(inon->arguments[1])->name); + if (MI && MI->get().setter==codegen.function_node->name) { + String n = static_cast(inon->arguments[1])->name; + _set_error("Must use '"+n+"' instead of 'self."+n+"' in setter.",inon); + return -1; + } + } + } +#endif + + int slevel=p_stack_level; GDParser::OperatorNode* op = static_cast(on->arguments[0]); -- cgit v1.2.3-70-g09d2