Program: 86751
Project: 86751
Buggy source:
@Override public void update(TimeStep timeStep){
  adjustments.poll();
  effects.update(timeStep);
  xOffset=yOffset=0;
  float weaponWeight=1.0f;
  ClientWeapon weapon=entity.getWeapon();
  if (weapon != null) {
    weaponWeight=100.0f - weapon.getWeaponWeight();
    weaponWeight*=0.01f;
  }
  activeBodyPosition=idleBody;
  activeLegsAnimation=idleLegsAnimation;
  Vector2f dir=entity.getFacing();
  State currentState=entity.getCurrentState();
switch (currentState) {
case IDLE:
    activeBodyPosition=idleBody;
  activeLegsAnimation=idleLegsAnimation;
resetLegMovements();
break;
case CROUCHING:
activeBodyPosition=crouchBody;
activeLegsAnimation=crouchingLegsAnimation;
resetLegMovements();
break;
case WALKING:
{
activeBodyPosition=walkBody;
activeLegsAnimation=walkLegsAnimation;
bobMotion.set(5,0.6);
swayMotion.set(0,0);
swayMotion.set(4,1.55 * weaponWeight);
xOffset+=(dir.y * swayMotion.direction) * 0.815f;
yOffset+=(dir.x * swayMotion.direction) * 0.815f;
}
break;
case RUNNING:
{
activeBodyPosition=runBody;
activeLegsAnimation=runLegsAnimation;
bobMotion.set(12 * weaponWeight,2.4 * weaponWeight);
swayMotion.set(4,2.5 * weaponWeight);
xOffset+=(dir.y * swayMotion.direction) * .755f;
yOffset+=(dir.x * swayMotion.direction) * .755f;
}
break;
case SPRINTING:
activeBodyPosition=sprintBody;
activeLegsAnimation=sprintLegsAnimation;
bobMotion.set(0,0);
swayMotion.set(4,3.25 * weaponWeight);
xOffset+=(dir.y * swayMotion.direction) * 1.25f;
yOffset+=(dir.x * swayMotion.direction) * 1.25f;
break;
case DEAD:
resetLegMovements();
break;
default :
resetLegMovements();
}
bobMotion.update(timeStep);
swayMotion.update(timeStep);
if (weapon != null) {
this.isReloading=weapon.getState() == seventh.game.weapons.Weapon.State.RELOADING;
this.isSwitching=weapon.getState() == seventh.game.weapons.Weapon.State.SWITCHING;
this.isMelee=weapon.getState() == seventh.game.weapons.Weapon.State.MELEE_ATTACK;
this.isFiring=weapon.getState() == seventh.game.weapons.Weapon.State.FIRING;
if (this.isReloading) {
this.activeBodyPosition=reloadBody;
}
 else if (this.isMelee) {
this.activeBodyPosition=meleeBody;
}
 else if (this.isSwitching) {
this.activeBodyPosition=switchWeaponBody;
}
if (weapon instanceof ClientRocketLauncher && !this.isMelee) {
activeBodyPosition=crouchBody;
}
AnimatedImage muzzleAnim=weapon.getMuzzleFlash();
if (muzzleAnim != null) {
muzzleAnim.update(timeStep);
}
}
if (this.isFiring) {
this.flashTime-=timeStep.getDeltaTime();
if (this.flashTime <= 0) {
boolean cycleFlash=weapon != null && weapon.isAutomatic();
if (cycleFlash) {
this.showFlash=!this.showFlash;
this.flashTime=90;
}
 else {
if (toggleFlash) {
this.showFlash=true;
this.flashTime=90;
toggleFlash=false;
}
 else {
this.showFlash=false;
}
}
}
}
 else {
this.showFlash=false;
this.toggleFlash=true;
this.flashTime=90;
}
if (entity.isAlive() && (entity.getLastUpdate() + 500) > timeStep.getGameClock()) {
entity.getMussleFlash().setOn(showFlash);
}
 else {
entity.getMussleFlash().setOn(false);
}
activeLegsAnimation.update(timeStep);
activeBodyPosition.update(timeStep);
}

Fixed version (ground truth):
@Override public void update(TimeStep timeStep){
  adjustments.poll();
  effects.update(timeStep);
  xOffset=yOffset=0;
  float weaponWeight=1.0f;
  ClientWeapon weapon=entity.getWeapon();
  if (weapon != null) {
    weaponWeight=100.0f - weapon.getWeaponWeight();
    weaponWeight*=0.01f;
  }
  activeBodyPosition=idleBody;
  activeLegsAnimation=idleLegsAnimation;
  Vector2f dir=entity.getFacing();
  State currentState=entity.getCurrentState();
switch (currentState) {
case IDLE:
    activeBodyPosition=idleBody;
  activeLegsAnimation=idleLegsAnimation;
resetLegMovements();
break;
case CROUCHING:
activeBodyPosition=crouchBody;
activeLegsAnimation=crouchingLegsAnimation;
resetLegMovements();
break;
case WALKING:
{
activeBodyPosition=walkBody;
activeLegsAnimation=walkLegsAnimation;
bobMotion.set(5,0.6);
swayMotion.set(4,1.55 * weaponWeight);
xOffset+=(dir.y * swayMotion.direction) * 0.815f;
yOffset+=(dir.x * swayMotion.direction) * 0.815f;
}
break;
case RUNNING:
{
activeBodyPosition=runBody;
activeLegsAnimation=runLegsAnimation;
bobMotion.set(12 * weaponWeight,2.4 * weaponWeight);
swayMotion.set(4,2.5 * weaponWeight);
xOffset+=(dir.y * swayMotion.direction) * 0.755f;
yOffset+=(dir.x * swayMotion.direction) * 0.755f;
}
break;
case SPRINTING:
activeBodyPosition=sprintBody;
activeLegsAnimation=sprintLegsAnimation;
bobMotion.set(0,0);
swayMotion.set(4,3.25 * weaponWeight);
xOffset+=(dir.y * swayMotion.direction) * 1.25f;
yOffset+=(dir.x * swayMotion.direction) * 1.25f;
break;
case DEAD:
resetLegMovements();
break;
default :
resetLegMovements();
}
bobMotion.update(timeStep);
swayMotion.update(timeStep);
if (weapon != null) {
this.isReloading=weapon.getState() == seventh.game.weapons.Weapon.State.RELOADING;
this.isSwitching=weapon.getState() == seventh.game.weapons.Weapon.State.SWITCHING;
this.isMelee=weapon.getState() == seventh.game.weapons.Weapon.State.MELEE_ATTACK;
this.isFiring=weapon.getState() == seventh.game.weapons.Weapon.State.FIRING;
if (this.isReloading) {
this.activeBodyPosition=reloadBody;
}
 else if (this.isMelee) {
this.activeBodyPosition=meleeBody;
}
 else if (this.isSwitching) {
this.activeBodyPosition=switchWeaponBody;
}
if (weapon instanceof ClientRocketLauncher && !this.isMelee) {
activeBodyPosition=crouchBody;
}
AnimatedImage muzzleAnim=weapon.getMuzzleFlash();
if (muzzleAnim != null) {
muzzleAnim.update(timeStep);
}
}
if (this.isFiring) {
this.flashTime-=timeStep.getDeltaTime();
if (this.flashTime <= 0) {
boolean cycleFlash=weapon != null && weapon.isAutomatic();
if (cycleFlash) {
this.showFlash=!this.showFlash;
this.flashTime=90;
}
 else {
if (toggleFlash) {
this.showFlash=true;
this.flashTime=90;
toggleFlash=false;
}
 else {
this.showFlash=false;
}
}
}
}
 else {
this.showFlash=false;
this.toggleFlash=true;
this.flashTime=90;
}
if (entity.isAlive() && (entity.getLastUpdate() + 500) > timeStep.getGameClock()) {
entity.getMussleFlash().setOn(showFlash);
}
 else {
entity.getMussleFlash().setOn(false);
}
activeLegsAnimation.update(timeStep);
activeBodyPosition.update(timeStep);
}