Merge pull request #100602 from KoBeWi/over_100_changes_in_50_random_files_aka_the_best_kind_of_PR

Add templated version of `ObjectDB::get_instance()`
This commit is contained in:
Thaddeus Crews
2025-03-31 12:03:47 -05:00
49 changed files with 121 additions and 104 deletions

View File

@@ -409,7 +409,7 @@ void CharacterBody2D::_set_collision_direction(const PhysicsServer2D::MotionResu
on_wall = true;
wall_normal = p_result.collision_normal;
// Don't apply wall velocity when the collider is a CharacterBody2D.
if (Object::cast_to<CharacterBody2D>(ObjectDB::get_instance(p_result.collider_id)) == nullptr) {
if (ObjectDB::get_instance<CharacterBody2D>(p_result.collider_id) == nullptr) {
_set_platform_data(p_result);
}
}

View File

@@ -58,7 +58,7 @@ real_t KinematicCollision2D::get_depth() const {
}
Object *KinematicCollision2D::get_local_shape() const {
PhysicsBody2D *owner = Object::cast_to<PhysicsBody2D>(ObjectDB::get_instance(owner_id));
PhysicsBody2D *owner = ObjectDB::get_instance<PhysicsBody2D>(owner_id);
if (!owner) {
return nullptr;
}