It's interesting seeing these original scripts (especially since I think SCI Companion's decompiler has trouble decompiling those particular scripts).
I remember reading about one of the bugs in QFG2's exporting, related to one poor coder's misunderstanding of how boolean math works, but it's neat being able to see it in black and white.
;; Bits in svMiscEquip
(define FINESWORD_BIT $0001) ; fine sword
(define FLAMESWORD_BIT $0002) ; flaming sword
(define COMPASS_BIT $0003) ; compass [NB, COMPASS_BIT == FINESWORD_BIT & FLAMESWORD_BIT]
(define PIN_BIT $0004) ; spahire pin
(define LAMP_BIT $0008) ; brass lamp
(define TOKEN_BIT $0010) ; EOF token
(define GLASSES_BIT $0020) ; X-Ray Glasses
; things transferred from "Quest for Glory 1"
(define BABA_BIT $0030) ; Flag set from QG1 [NB, BABA_BIT == TOKEN_BIT & GLASSES_BIT]
(define SWORD_BIT $0040) ; Sword
(define CHAIN_BIT $0080) ;
(define PICK_BIT $0100) ;
(define TOOL_BIT $0200) ;
I knew about the COMPASS_BIT, but the BABA_BIT is new to me. It's interesting to see that the QFG3 import code also replicates the bug... I wonder if it just wasn't noticed as being wrong then. I imagine the AGD team had to leave that bug as is in QFG2VGA, because it's just too intwined to change, without breaking compatibility with QFG3/4.