Drake53 / War3Net

A .NET implementation of Warcraft III related libraries.
MIT License
123 stars 27 forks source link

get_ValueAsBool error when building map #23

Closed YakaryBovine closed 2 years ago

YakaryBovine commented 2 years ago

Hi, I get this error when I try to build my map:

image

image

Seems that it cannot conert the "ubdg" unit modification into a boolean.

Here is my repo if you'd like to reproduce the error on your end. Just need to run the Launcher and hit 3. https://github.com/YakaryBovine/AzerothWarsCSharp/tree/jass-transpiled

Drake53 commented 2 years ago

ValueAsBool/etc doesn't actually convert the value, it only checks if the 'object Value' property is a bool. However, as you can also see from the Type property, it's actually an int. So it actually seems more like an issue with your war3map.w3u file which has saved an ubdg property as int, even though according to unitmetadata.slk this property should be a bool.

YakaryBovine commented 2 years ago

Cool, that makes sense. It wouldn't be the first time this map has had broken data. I'll just confirm before I close.

YakaryBovine commented 2 years ago

Ok, I don't think the problem is on my end. You can reproduce the issue on a new map like so:

  1. Place a Way Gate on the map.
  2. Place a region on the map.
  3. Make the region the destination of the Way Gate. image
  4. Change the Way Gate unit type's Is a Building field to false. image
Drake53 commented 2 years ago

Forgot this was a thing: https://github.com/Drake53/War3Api/issues/14 Should be fixed in v5.4.2: https://github.com/Drake53/War3Net/commit/4f6ac27da194106ee0eba1549468e4360ef65618

YakaryBovine commented 2 years ago

Yep, that fixed it and I can now build again. Thankyou!