KnuckleCracker / CW4-bug-tracker

The gathering point for bugs and supporting information, or suggestions about additional features.
Creative Commons Attribution Share Alike 4.0 International
13 stars 1 forks source link

[Bug] Altering Bomber health crashes CW4 when parent bomber pad is destroyed. (Possibly applies to all "sub-units"). #1043

Closed VertuTheMapMaker closed 2 years ago

VertuTheMapMaker commented 2 years ago

In my VPAC maps, I have not been a fan of how squishy bombers are (thanks to how much game balance I have messed with) and have devised a way to increase the Bomber unit's HP. It works great... until you kill their bomber pad which then causes CW4 to crash. And unlike my past uses of "crash", this is an actual crash. I get a crash window to force close CW4. My assumption is that when a bomberpad is destroyed, the way it handles with destroying bomber units can not deal with their massively increased health and something goes wrong with destroying it, causing a full crash.

Player.log Player-prev.log

Code that does all of this:

if(GetGameUpdateCount eq(2))
once
    GetUnits("" V3(0 0 0) 1800 false false false 2 0 0) ->manyUnits
    do(GetListCount(<-manyUnits) 0)
        if(GetUnitOfficialname(<-manyUnits[I]) eq("Bomber"))
            SetUnitMaxHealth(<-manyUnits[I] 12)
            SetUnitHealth(<-manyUnits[I] GetUnitMaxHealth(<-manyUnits[I]))
        endif
    loop
endonce
endif

When the code runs and you go and destroy the bomberpads (I did so using just Creeper for consistency), upon bomberpad destruction the game will crash. Simple as that! I will not be surprised if this applies to all "sub-units" like the TerpDrone, RefineryDrone, etc.

VertuTheMapMaker commented 2 years ago

Very annoying circumstances have made this appear as an issue. It was nothing more than very consistent coincidence. The real cause however seems stranger.