aboutsummaryrefslogtreecommitdiff
path: root/test-client
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-09 14:52:54 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-09 14:52:54 +0200
commit13cbcc920a2756376e0005046b4b82c68eb9c9da (patch)
treebabcd00e7fedc9a2fd8001d3435d7c1268aeb414 /test-client
parent52f7b5833510b0e55d4942d99f1c8046643ee31d (diff)
downloadhurrycurry-13cbcc920a2756376e0005046b4b82c68eb9c9da.tar
hurrycurry-13cbcc920a2756376e0005046b4b82c68eb9c9da.tar.bz2
hurrycurry-13cbcc920a2756376e0005046b4b82c68eb9c9da.tar.zst
implement auto release on active (and passive) recipes
Diffstat (limited to 'test-client')
-rw-r--r--test-client/main.ts2
-rw-r--r--test-client/protocol.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/test-client/main.ts b/test-client/main.ts
index 2987af54..f295e0ca 100644
--- a/test-client/main.ts
+++ b/test-client/main.ts
@@ -284,7 +284,7 @@ export function get_interact_target(): V2 | undefined {
function set_interact(edge: boolean) {
if (edge) interacting = get_interact_target()
- if (interacting) send({ type: "interact", pos: [interacting.x, interacting.y], edge })
+ if (interacting) send({ type: "interact", pos: edge ? [interacting.x, interacting.y] : undefined })
if (!edge) interacting = undefined
}
diff --git a/test-client/protocol.ts b/test-client/protocol.ts
index 34efe602..ddbc43c8 100644
--- a/test-client/protocol.ts
+++ b/test-client/protocol.ts
@@ -33,7 +33,7 @@ export type PacketS =
{ type: "join", name: string, character: number } // Spawns your character. Dont send it to spectate.
| { type: "leave" } // Despawns your character
| { type: "position", pos: Vec2, rot: number, boosting: boolean } // Update your position and rotation in radians (0 is -y)
- | { type: "interact", pos: Vec2, edge: boolean } // Interact with some tile. edge is true when pressing and false when releasing interact button
+ | { type: "interact", pos?: Vec2 } // Interact with some tile. pos is a position when pressing and null when releasing interact button
| { type: "communicate", message?: Message, persist: boolean } // Send a message
| { type: "collide", player: PlayerID, force: Vec2 } // Apply force to another player as a result of a collision