@@ -5,7 +5,7 @@ import SpecializationId from "./Database/SpecializationIds";
55import Overrides from "./Database/Overrides" ;
66import { ALL_EQUIPMENT_COUNT , ALL_INFUSION_COUNT , CURRENT_VERSION , FIRST_VERSIONED_VERSION , HasAttributeSlot , HasInfusionSlot , IsTwoHanded } from "./Database/Static" ;
77import StatId from "./Database/StatIds" ;
8- import { Arbitrary , BuildCode , IArbitrary , IProfessionSpecific , Kind , Legend , PetId , Profession , ProfessionSpecific , RangerData , RevenantData , Specialization , TraitLineChoice , WeaponSet , WeaponType } from "./Structures" ;
8+ import { Arbitrary , BuildCode , IArbitrary , IProfessionSpecific , Kind , Legend , PetId , Profession , ProfessionSpecific , RangerData , RevenantData , AmalgamData , Specialization , TraitLineChoice , WeaponSet , WeaponType } from "./Structures" ;
99import { AllEquipmentInfusions , AllEquipmentStats , TraitLineChoices } from "./Util/UtilStructs" ;
1010import BinaryView from "./Util/BinaryView" ;
1111import { Assert } from "./Util/Static" ;
@@ -171,7 +171,7 @@ class BinaryLoader {
171171 code . Food = rawSpan . DecodeNext ( 24 ) ;
172172 code . Utility = rawSpan . DecodeNext ( 24 ) ;
173173 }
174- code . ProfessionSpecific = BinaryLoader . LoadProfessionSpecific ( rawSpan , code . Profession ) ;
174+ code . ProfessionSpecific = BinaryLoader . LoadProfessionSpecific ( rawSpan , code . Profession , code . Specializations . Choice3 . SpecializationId ) ;
175175 code . Arbitrary = BinaryLoader . LoadArbitrary ( rawSpan ) ;
176176
177177 return code ;
@@ -232,7 +232,7 @@ class BinaryLoader {
232232 return allData ;
233233 }
234234
235- private static LoadProfessionSpecific ( rawSpan : BitReader , profession : Profession ) : IProfessionSpecific
235+ private static LoadProfessionSpecific ( rawSpan : BitReader , profession : Profession , eliteSpec : SpecializationId ) : IProfessionSpecific
236236 {
237237 switch ( profession )
238238 {
@@ -257,6 +257,15 @@ class BinaryLoader {
257257 return data ;
258258 }
259259
260+ case Profession . Engineer : if ( eliteSpec == SpecializationId . Amalgam ) {
261+ var data = new AmalgamData ( ) ;
262+ data . ToolbeltSkill2 = rawSpan . DecodeNext ( 24 ) ;
263+ data . ToolbeltSkill3 = rawSpan . DecodeNext ( 24 ) ;
264+ data . ToolbeltSkill4 = rawSpan . DecodeNext ( 24 ) ;
265+ return data ;
266+ }
267+ // fallthrough
268+
260269 default : return ProfessionSpecific . NONE . Instance ;
261270 }
262271 }
@@ -411,6 +420,15 @@ class BinaryLoader {
411420 rawBits . Write ( revenantData . AltUtilitySkill3 , 24 ) ;
412421 }
413422 break ;
423+
424+ case Profession . Engineer :
425+ if ( code . Specializations . Choice3 . SpecializationId == SpecializationId . Amalgam ) {
426+ const amalgamData = code . ProfessionSpecific as AmalgamData ;
427+ rawBits . Write ( amalgamData . ToolbeltSkill2 , 24 ) ;
428+ rawBits . Write ( amalgamData . ToolbeltSkill3 , 24 ) ;
429+ rawBits . Write ( amalgamData . ToolbeltSkill4 , 24 ) ;
430+ }
431+ break ;
414432 }
415433
416434 return new Uint8Array ( rawBits . Data ) ;
0 commit comments