If the source parameter passed to a ProcessDirectDamage call on a survivor NPC (SurvivorBase/PlayerBase) is a gas pump (Land_FuelStation_Feed), the game segfaults.
Description
Description
Details
Details
- Severity
- None
- Resolution
- Open
- Reproducibility
- N/A
- Operating System
- Windows 10 x64
- Category
- Modding
Steps To Reproduce
Quick and dirty reproduction steps that creates a survivor NPC at the fuel pump nearest (within 30 m) to the 1st player and tries to apply damage to it:
PlayerBase pb = PlayerBase.Cast(GetGame().GetPlayerByIndex(0)); //! Get 1st player //! Find nearest fuel pump Land_FuelStation_Feed source; array<Object> objects = {}; array<CargoBase> proxyCargos = {}; Object target; GetGame().GetObjectsAtPosition3D(pb.GetPosition(), 30, objects, proxyCargos); foreach (Object obj: objects) { if (Class.CastTo(source, obj)) { //! Create survivor NPC target = GetGame().CreateObject("SurvivorM_Mirek", source.GetPosition()); break; } } if (target) { string dmgZone = ""; string ammoType = "LandFuelFeed_Ammo"; vector modelPos = source.GetPosition(); float dmgCoef = 1; int directDamageFlags = ProcessDirectDamageFlags.ALL_TRANSFER; target.ProcessDirectDamage(DamageType.EXPLOSION, source, dmgZone, ammoType, modelPos, dmgCoef, directDamageFlags); //! Segfault }