
Also, having C4Value::Set default to C4V_Nil doesn't seem save, there might be code which relies on CnvGuess. Better to remove the default entirely than this.
And I don't think we need a new type for this. As far as I can see, the only benefit is that false and zero the integer are distinct from zero the nullpointer. Zero the nullpointer can continue to use the type any. We should rather remove any uses of CnvGuess now that we don't need to load old savegames anymore.

>the only benefit is that false and zero the integer are distinct from zero the nullpointer.
And a lot about parameters would change. Currently we have the problem that, for example, you cannot play a sound (via Sound()) only for the player with the number 0. Why? Because 0 means "for all" there. nil would make stuff like that a lot easier, because it would remove such ambiguities

Imo, adding another element of confusion is *not* helpful in this case. Because it would mean we'd have to change certain parameters to accept two possible types (in this case, integer and nil) and "nil" would have different meanings for different functions. It is much more straightforward to define constants of the correct type. In this case, it would be Sound(..., NO_OWNER); or you could make it something like Sound(..., SND_AllPlayers) if you wanted to. Other examples of this method include NoContainer/AnyContainer - something you can't do with nil, since there's only one nil.



Isilkor already addressed my concerns, nil now has type C4V_Any and the other problems are resolved.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill