@@ -104,10 +104,10 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
104104 // chomping animation
105105 const src = match . currentRound . bodies . getById ( this . robotId ) // cat
106106 // const target = match.currentRound.bodies.getById(this.actionData.id()) // rat being eaten
107- const coords = renderUtils . getRenderCoords ( src . pos . x , src . pos . y , match . map . dimension , true )
108- const random1 = ( ( src . pos . x * 491 + src . pos . y * 603 + match . currentRound . roundNumber * 343 ) / 100 ) % 1 // https://xkcd.com/221/
109- const random2 = ( ( src . pos . x * 259 + src . pos . y * 429 + match . currentRound . roundNumber * 224 ) / 100 ) % 1
110- const interpolationFactor = match . getInterpolationFactor ( )
107+ // const coords = renderUtils.getRenderCoords(src.pos.x, src.pos.y, match.map.dimension, true)
108+ // const random1 = ((src.pos.x * 491 + src.pos.y * 603 + match.currentRound.roundNumber * 343) / 100) % 1 // https://xkcd.com/221/
109+ // const random2 = ((src.pos.x * 259 + src.pos.y * 429 + match.currentRound.roundNumber * 224) / 100) % 1
110+ // const interpolationFactor = match.getInterpolationFactor()
111111
112112 // ctx.save()
113113 // ctx.globalAlpha = 0.5 - 0.5 * interpolationFactor * interpolationFactor
@@ -194,8 +194,11 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
194194
195195 if ( target . beingCarried ) {
196196 // drop the target
197- const carrier = round . bodies . getById ( target . carrierRobot ! )
198- carrier . carriedRobot = undefined
197+ // const carrier = round.bodies.getById(target.carrierRobot!)
198+ if ( target . carrierRobot !== undefined ) {
199+ const carrier = round . bodies . getById ( target . carrierRobot )
200+ carrier . carriedRobot = undefined
201+ }
199202 target . size = 1
200203 target . beingCarried = false
201204 target . carrierRobot = undefined
0 commit comments