Unpack bool as int

This commit is contained in:
ChillerDragon 2022-11-15 11:09:54 +01:00
parent 92e7400796
commit 096fa110a6

View file

@ -347,7 +347,12 @@ function action_generate() {
for field_name in "${!fields[@]}" for field_name in "${!fields[@]}"
do do
field_type="${fields[$field_name]}" field_type="${fields[$field_name]}"
if [ "$field_type" == "bool" ]
then
unpacks+="\n @$field_name = u.get_int"
else
unpacks+="\n @$field_name = u.get_$field_type" unpacks+="\n @$field_name = u.get_$field_type"
fi
done done
replace_line "$tmpfile" Unpacker.new " u = Unpacker.new(data)$unpacks" replace_line "$tmpfile" Unpacker.new " u = Unpacker.new(data)$unpacks"