#!/usr/bin/env bash # ========================================================================= # #142 -- does CROUCH reset on respawn? (Oracle: "crouch wasn't resetting # on respawn ... i guess mechs always spawn standing") # # Mech::Reset (@0049fb74) stands the mech up in the binary: # *(this+0x398) = 0 duckState # legStateAlarm -> 0 (this+0x39c) # bodyStateAlarm -> 0 (this+0x714) # death + leg/body reset latches, idleStrideScale = 1.0 # The port had dropped every one of those, so a pilot who died CROUCHED came # back crouched. # # THE TEST: A crouches, then is killed while crouched, then respawns. # PASS: after "[respawn] Mech::Reset", the leg alarm is 0 (standing) and # duckState is 0 -- and no squat clip is parked. # FAIL: legLvl stays 1 (parked in 'sqd') across the respawn. # # B force-damages A so the death lands while A is parked in the squat. # ========================================================================= set -x . /c/git/bt411/scratchpad/night6/bench_common.sh cd /c/git/bt411/content || exit 1 taskkill //F //IM btl4.exe > /dev/null 2>&1 sleep 2 rm -f dr_a.log dr_b.log dr_relay.log bt_expert_egg MP.EGG DR.EGG sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" DR.EGG ( export BT_DEATH_LOG=1 BT_MP_LOG=1 bt_launch dr_b.log DR.EGG 0x0C -net 1601 ) sleep 2 # A: crouch early and STAY down, so the kill lands on a crouched mech ( export BT_BTNTEST=0x13,900,960 BT_SELF_DAMAGE=6 export BT_DUCK_LOG=1 BT_DEATH_LOG=1 BT_MP_LOG=1 BT_KEY_NOFOCUS=1 bt_launch dr_a.log DR.EGG 0x03 -net 1501 ) sleep 5 python ../tools/btconsole.py DR.EGG 127.0.0.1:1501 127.0.0.1:1601 > dr_relay.log 2>&1 & RELAY=$! sleep 260 kill $RELAY 2>/dev/null sleep 3 bt_kill_ours; sleep 2; taskkill //F //IM btl4.exe > /dev/null 2>&1; sleep 3 echo "=================== #142 CROUCH ACROSS RESPAWN ===================" echo "--- did A crouch, then die, then respawn? ---" grep -aE "\[duck\] (SQUAT|RISE)|death cycle START|Mech::Reset" dr_a.log | head -8 echo echo "--- leg alarm around the respawn (1 = parked in 'sqd', 0 = standing) ---" grep -aE "probe legLvl|Mech::Reset" dr_a.log | tail -12 echo echo "--- the strip's frame after respawn (must NOT be the up-arrow) ---" grep -a "probe legLvl" dr_a.log | tail -3