Lights to place indoors (tallow candle, torch stand); docs brought up to date; the journey plan; sticky teleports in net tests; protocol 15
This commit is contained in:
@@ -327,11 +327,18 @@ func _wolves() -> void:
|
||||
|
||||
# --- helpers --------------------------------------------------------------------
|
||||
|
||||
## Teleports Alice (the server moves her) and makes sure it sticks: a last
|
||||
## position update her game sent from before the move can reach the server
|
||||
## after it, look like a jump, and get her moved back ("too fast"). So check
|
||||
## she's still there a moment later, and go again if not.
|
||||
func _tp(at: Vector3) -> void:
|
||||
PN.ask("debug_tp", [at + Vector3(0, 0.05, 0)])
|
||||
await _until(func(): return player.global_position.distance_to(at) < 1.0, 2.0)
|
||||
player.set_physics_process(false)
|
||||
await _sleep(0.3)
|
||||
for _try in range(3):
|
||||
PN.ask("debug_tp", [at + Vector3(0, 0.05, 0)])
|
||||
await _until(func(): return player.global_position.distance_to(at) < 1.0, 2.0)
|
||||
player.set_physics_process(false)
|
||||
await _sleep(0.5)
|
||||
if player.global_position.distance_to(at) < 1.0:
|
||||
return
|
||||
|
||||
func _give(id: String, n: int) -> int:
|
||||
var before: int = player.inventory.count(id)
|
||||
|
||||
Reference in New Issue
Block a user