BattletechModders / CBTBehaviorsEnhanced

Applies Classic BattleTech behaviors to the HBS BattleTech Game
MIT License
5 stars 6 forks source link

Cluster damage causes CAC warning message #92

Open IceRaptor opened 3 years ago

IceRaptor commented 3 years ago

CAC logs include this line: [11:55:40.957]WeaponHitInfo at grp:0 index:System.Nullable1[BattleTech.WeaponHitInfo][][] is null. How?! Again weapon without representation?! You realy should stop it!`

Per discussion with KMission, this is my fault because I'm not generating a weaponRef inside of CreateImaginaryAttack.

IceRaptor commented 3 years ago

all melee weapon in game have one representation if (!this.MeleeWeapon.baseComponentRef.hasPrefabName) { this.MeleeWeapon.baseComponentRef.prefabName = "chrPrfWeap_generic_melee"; this.MeleeWeapon.baseComponentRef.hasPrefabName = true; } this.MeleeWeapon.InitGameRep(this.MeleeWeapon.baseComponentRef.prefabName, this.GetAttachTransform(this.MeleeWeapon.mechComponentRef.MountedLocation), this.LogDisplayName); you should just call InitGameRep for your self damage weapon