17.10.2009, 07:48:21
It's not exactly either one of those.
If you look at [General], you'll see an "Adds to List" column, which, if checked, indicates that a value of that flag is added to the appropriate internal array even if it's not listed under [InfantryTypes] or such. Depending on whether that specific flag is read before or after the game decides it's time to read the INI data for currently defined [InfantryTypes], the value added by such a flag can ignore its INI properties set in the rules. (This is why Shrapnel weapons cause a crash, cause this flag is parsed after the WeaponTypes list has been processed.) This is a fairly stupid idea, but hey, it's Westwood.
pd's original code also used InfantryTypeClass::FindOrAllocate to parse [Side]Crew= and several other flags, I never corrected this .. until now . So this will be corrected in the next build, whenever that is... question is, just how extensively should this be fixed? I'm definitely going to fix all Ares flags to not add to the array if entries are not present, and I'm going to add log file entries warning about failed lookups. As much as I want to also fix the game's stock parsing, that would break so many mods it would not be funny. Maybe I should add a flag [GlobalControls]StrictLookups=y/[n] for mods who want it... Or even make a failed lookup into a fatal error instead of a warning...
If you look at [General], you'll see an "Adds to List" column, which, if checked, indicates that a value of that flag is added to the appropriate internal array even if it's not listed under [InfantryTypes] or such. Depending on whether that specific flag is read before or after the game decides it's time to read the INI data for currently defined [InfantryTypes], the value added by such a flag can ignore its INI properties set in the rules. (This is why Shrapnel weapons cause a crash, cause this flag is parsed after the WeaponTypes list has been processed.) This is a fairly stupid idea, but hey, it's Westwood.
pd's original code also used InfantryTypeClass::FindOrAllocate to parse [Side]Crew= and several other flags, I never corrected this .. until now . So this will be corrected in the next build, whenever that is... question is, just how extensively should this be fixed? I'm definitely going to fix all Ares flags to not add to the array if entries are not present, and I'm going to add log file entries warning about failed lookups. As much as I want to also fix the game's stock parsing, that would break so many mods it would not be funny. Maybe I should add a flag [GlobalControls]StrictLookups=y/[n] for mods who want it... Or even make a failed lookup into a fatal error instead of a warning...