Skip to content

Commit 9862cd6

Browse files
committed
Merge branch 'schema' into trap_changes
2 parents 2a41b03 + 8bb522e commit 9862cd6

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

client/src/playback/Actions.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,18 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
189189
const src = round.bodies.getById(this.robotId)
190190
const target = round.bodies.getById(this.actionData.id()) // rat getting napped
191191

192-
if(src.carriedRobot === target.id) {
192+
if (target.beingCarried) {
193193
// drop the target
194-
src.carriedRobot = undefined
195194
target.size = 1
195+
target.beingCarried = false
196196
} else {
197197
// pick up the target
198198
src.carriedRobot = target.id
199199
target.carriedRobot = undefined
200+
target.beingCarried = true
200201

201-
target.lastPos = { ...target.pos }
202-
target.pos = { x: src.pos.x + RatNapAction.OFFSET.x, y: src.pos.y + RatNapAction.OFFSET.y }
202+
// target.lastPos = { ...target.pos }
203+
// target.pos = { x: src.pos.x + RatNapAction.OFFSET.x, y: src.pos.y + RatNapAction.OFFSET.y }
203204
target.size = 0.6
204205
}
205206
}

client/src/playback/Bodies.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ export class Body {
364364
public actionCooldown: number = 0
365365
public turningCooldown: number = 0
366366
public carriedRobot: number | undefined = undefined // id of carried robot
367+
public beingCarried: boolean = false
367368
public bytecodesUsed: number = 0
368369
public cheese: number = 0
369370

0 commit comments

Comments
 (0)