Skip to content

Commit 3f6c631

Browse files
committed
fix small rats
1 parent 1073393 commit 3f6c631

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

client/src/playback/Actions.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,10 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
195195
if (target.beingCarried) {
196196
// drop the target
197197
// const carrier = round.bodies.getById(target.carrierRobot!)
198-
if(target.carrierRobot !== undefined) {
198+
if(target.carrierRobot !== undefined && round.bodies.hasId(target.carrierRobot)) {
199199
const carrier = round.bodies.getById(target.carrierRobot)
200200
carrier.carriedRobot = undefined
201201
}
202-
target.size = 1
203202
target.beingCarried = false
204203
target.carrierRobot = undefined
205204
} else {
@@ -210,8 +209,7 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
210209
target.beingCarried = true
211210

212211
target.lastPos = { ...target.pos }
213-
// target.pos = { x: src.pos.x + RatNapAction.OFFSET.x, y: src.pos.y + RatNapAction.OFFSET.y }
214-
target.size = 0.6
212+
// target.pos = { x: src.pos.x + RatNapAction.OFFSET.x, y: src.pos.y + RatNapAction.OFFSET.y }
215213
}
216214
}
217215
draw(match: Match, ctx: CanvasRenderingContext2D): void {
@@ -576,7 +574,6 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
576574
carrier.carriedRobot = undefined
577575
}
578576
body.carrierRobot = undefined
579-
body.beingCarried = false
580577
body.size = 1
581578
// body.pos = { ...endLoc }
582579
}

client/src/playback/Bodies.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,6 @@ export class Body {
432432
}
433433

434434
public draw(match: Match, ctx: CanvasRenderingContext2D): void {
435-
const OFFSET = { x: .35, y: 0 } // to center the rat on the tile
436-
const ratnapped = this.robotType === schema.RobotType.RAT && this.beingCarried
437-
438435
const pos = this.getInterpolatedCoords(match)
439436

440437
const renderCoords = renderUtils.getRenderCoords(pos.x, pos.y, match.currentRound.map.staticMap.dimension)

0 commit comments

Comments
 (0)