summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCarl Olsson <carl.olsson@gmail.com>2015-03-23 08:19:20 +1000
committerCarl Olsson <carl.olsson@gmail.com>2015-03-23 08:19:20 +1000
commitfb2cdfe7edcc2ccafea7604afd104f582e5b9c17 (patch)
treed9555d9519648f95d7ed3663fbca50978bb12a1f /modules
parent41686d5fdd0d72f167894f976d19b177789f1f63 (diff)
parente9f94ce8d2cc6805e74fffdf733e6dc5b5c530f5 (diff)
Merge branch 'master' of https://github.com/not-surt/godot into snapping2
Conflicts: tools/editor/plugins/canvas_item_editor_plugin.cpp tools/editor/plugins/canvas_item_editor_plugin.h
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gd_functions.cpp2
-rw-r--r--modules/gdscript/gd_script.cpp8
-rw-r--r--modules/gridmap/grid_map.cpp3
3 files changed, 9 insertions, 4 deletions
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp
index b616d8f228..f37b2f645a 100644
--- a/modules/gdscript/gd_functions.cpp
+++ b/modules/gdscript/gd_functions.cpp
@@ -1101,7 +1101,7 @@ MethodInfo GDFunctions::get_info(Function p_func) {
return mi;
} break;
case MATH_LERP: {
- MethodInfo mi("lerp",PropertyInfo(Variant::REAL,"a"),PropertyInfo(Variant::REAL,"b"), PropertyInfo(Variant::REAL,"c"));
+ MethodInfo mi("lerp",PropertyInfo(Variant::REAL,"from"),PropertyInfo(Variant::REAL,"to"), PropertyInfo(Variant::REAL,"weight"));
mi.return_val.type=Variant::REAL;
return mi;
} break;
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index 0aa115ffbc..06c746c4fb 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -337,9 +337,10 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
Variant::evaluate(op,*a,*b,*dst,valid);
if (!valid) {
- if (false && dst->get_type()==Variant::STRING) {
+ if (dst->get_type()==Variant::STRING) {
//return a string when invalid with the error
err_text=*dst;
+ err_text += " in operator '"+Variant::get_operator_name(op)+"'.";
} else {
err_text="Invalid operands '"+Variant::get_type_name(a->get_type())+"' and '"+Variant::get_type_name(b->get_type())+"' in operator '"+Variant::get_operator_name(op)+"'.";
}
@@ -2696,7 +2697,10 @@ Error ResourceFormatSaverGDScript::save(const String &p_path,const RES& p_resour
}
file->store_string(source);
-
+ if (file->get_error()!=OK && file->get_error()!=ERR_FILE_EOF) {
+ memdelete(file);
+ return ERR_CANT_CREATE;
+ }
file->close();
memdelete(file);
return OK;
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 7c344e1e90..441b274e33 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -122,7 +122,7 @@ bool GridMap::_set(const StringName& p_name, const Variant& p_value) {
Octant &g = *octant_map[ok];
g.baked=b;
- g.bake_instance=VS::get_singleton()->instance_create();;
+ g.bake_instance=VS::get_singleton()->instance_create();;
VS::get_singleton()->instance_set_base(g.bake_instance,g.baked->get_rid());
VS::get_singleton()->instance_geometry_set_baked_light(g.bake_instance,baked_light_instance?baked_light_instance->get_baked_light_instance():RID());
}
@@ -418,6 +418,7 @@ void GridMap::set_cell_item(int p_x,int p_y,int p_z, int p_item,int p_rot){
Octant *g = memnew( Octant );
g->dirty=true;
g->static_body = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC);
+ PhysicsServer::get_singleton()->body_attach_object_instance_ID(g->static_body,get_instance_ID());
if (is_inside_world())
PhysicsServer::get_singleton()->body_set_space(g->static_body,get_world()->get_space());