Proper town logic; needs lots of fixing

This commit is contained in:
Segey Lapin
2021-10-25 13:36:58 +03:00
parent aef8a11cc4
commit 6442245253
5 changed files with 92 additions and 28 deletions

View File

@@ -352,7 +352,7 @@ void Characters_::character_physics(Object *obj)
} else if (obj->has_meta("cmdqueue") && obj->has_meta("climb")) {
go = true;
}
if (!kb->is_on_floor() && !obj->has_meta("climb"))
if (!kb->is_on_floor() && !obj->has_meta("climb") && !obj->has_meta("vehicle"))
velocity += Vector3(0.0f, -9.8f, 0.0f);
if (go)
velocity = kb->move_and_slide(velocity, Vector3(0.0f, 1.0f, 0.0f), true, 4, 0.785f, false);
@@ -605,7 +605,6 @@ void Characters_::_notification(int p_what)
continue;
if (!ch->has_meta("orientation"))
continue;
printf("running physics for %p\n", ch);
character_physics(ch);
Spatial *sp = Object::cast_to<Spatial>(ch);
Vector3 direction = sp->get_global_transform().xform(Vector3(0, 0, -1));