NS-23: Fix const LEDGE_DROP_STEPS (Godot const expression rule)
parent
b007c7fe58
commit
394e2a71fb
|
|
@ -14,7 +14,7 @@ const STEP_MAX_HEIGHT: float = 0.32
|
||||||
const STEP_PROBE_FWD: float = 0.38
|
const STEP_PROBE_FWD: float = 0.38
|
||||||
const STUCK_HORIZ_SPEED: float = 0.28
|
const STUCK_HORIZ_SPEED: float = 0.28
|
||||||
## Drop tries when leaving a bump (combined with forward over the lip).
|
## Drop tries when leaving a bump (combined with forward over the lip).
|
||||||
const LEDGE_DROP_STEPS: PackedFloat32Array = PackedFloat32Array([0.08, 0.12, 0.18, 0.24, 0.32])
|
const LEDGE_DROP_STEPS = [0.08, 0.12, 0.18, 0.24, 0.32]
|
||||||
|
|
||||||
var _has_walk_goal: bool = false
|
var _has_walk_goal: bool = false
|
||||||
var _auth_walk_goal: Vector3 = Vector3.ZERO
|
var _auth_walk_goal: Vector3 = Vector3.ZERO
|
||||||
|
|
@ -90,8 +90,7 @@ func _autostep_up(xf: Transform3D, motion_fwd: Vector3, dir_h: Vector3) -> bool:
|
||||||
|
|
||||||
|
|
||||||
func _autostep_down(xf: Transform3D, motion_fwd: Vector3, dir_h: Vector3) -> bool:
|
func _autostep_down(xf: Transform3D, motion_fwd: Vector3, dir_h: Vector3) -> bool:
|
||||||
for i: int in range(LEDGE_DROP_STEPS.size()):
|
for drop: float in LEDGE_DROP_STEPS:
|
||||||
var drop: float = LEDGE_DROP_STEPS[i]
|
|
||||||
var motion_off: Vector3 = motion_fwd + Vector3(0.0, -drop, 0.0)
|
var motion_off: Vector3 = motion_fwd + Vector3(0.0, -drop, 0.0)
|
||||||
if test_move(xf, motion_off):
|
if test_move(xf, motion_off):
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue