Skip to content

Commit

Permalink
Fix spec. agents at position 0,0,0 on first frame
Browse files Browse the repository at this point in the history
  • Loading branch information
Razoric480 committed May 24, 2020
1 parent ca1a708 commit 4d4c721
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This document lists new features, improvements, changes, and bug fixes in every

- KinematicBody2DAgents and KinematicBody3DAgents that moved fast enough no longer reverse velocity suddenly during a frame where no acceleration is applied.
- Specialized Agents like RigidBody2DAgent should no longer crash due to a missing reference.
- Specialized physics agents no longer believe they are at 0,0,0 on the first frame.

## Godot Steering AI Framework 2.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func _init(_body: KinematicBody2D, _movement_type: int = MovementType.SLIDE) ->
if not _body.is_inside_tree():
yield(_body, "ready")

_body_ref = weakref(_body)
self.body = _body
self.movement_type = _movement_type

# warning-ignore:return_value_discarded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ var _body_ref: WeakRef


func _init(_body: KinematicBody, _movement_type: int = MovementType.SLIDE) -> void:
body = _body
if not _body.is_inside_tree():
yield(_body, "ready")

self._body_ref = weakref(_body)
self.body = _body
self.movement_type = _movement_type

# warning-ignore:return_value_discarded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ var _body_ref: WeakRef


func _init(_body: RigidBody2D) -> void:
body = _body
if not _body.is_inside_tree():
yield(_body, "ready")
self.body = _body

_body_ref = weakref(_body)
# warning-ignore:return_value_discarded
_body.get_tree().connect("physics_frame", self, "_on_SceneTree_frame")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ var _last_position: Vector3
var _body_ref: WeakRef

func _init(_body: RigidBody) -> void:
body = _body
if not _body.is_inside_tree():
yield(_body, "ready")
self.body = _body

_body_ref = weakref(_body)
# warning-ignore:return_value_discarded
_body.get_tree().connect("physics_frame", self, "_on_SceneTree_frame")

Expand Down

0 comments on commit 4d4c721

Please sign in to comment.