diff options
-rw-r--r-- | core/ustring.cpp | 9 | ||||
-rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index 945c841568..3cfc1e4a3c 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -67,11 +67,14 @@ void String::copy_from(const char *p_cstr) { return; } + resize(len+1); // include 0 - for(int i=0;i<len+1;i++) { - - set(i,p_cstr[i]); + CharType *dst = this->ptr(); + + for (int i=0;i<len+1;i++) { + + dst[i]=p_cstr[i]; } } diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 9b69ab299d..767ad9038d 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -657,8 +657,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body,const Vector2&p_motion,float p const Body2DSW *body=static_cast<const Body2DSW*>(col_obj); Vector2 cdir = body->get_one_way_collision_direction(); - if (cdir!=Vector2() && p_motion.dot(cdir)<0) - continue; + //if (cdir!=Vector2() && p_motion.dot(cdir)<0) + // continue; cbk.valid_dir=cdir; cbk.valid_depth=body->get_one_way_collision_max_depth(); |