RIndexOf returns the index where the substring starts, instead of the index where the substring ends - 1.
Deprecate the LastIndexOf method of StringStruct
This setup has been a constant source of problems so now I reviewed all uses of FName to make sure that everything that needs to be initialized is done manually.
This also merges the player_t constructor into the class definition as default values.
This is mainly to allow retroactive addition to existing virtual functions without breaking existing content.
The MeansOfDeath fix for Actor.Die would not be possible without such handling.
Due to how function calls get resolved by the code generator there were some incorrect flags on the self pointer which triggered an assert and caused incorrect code generation.
Fortunately this was a mostly contained special case for which a workaround was possible.
The case with forward declared class used as a parent must be handled explicitly
actor MyWeapon : Weapon { Weapon.AmmoType "MyBaseAmmo" }
actor MyAmmo : MyBaseAmmo { }
actor MyBaseAmmo : Ammo { }
This data is game critical and may only be altered by code that knows what is allowed and what not. It must never be altered by any user code ever.
However, since the SkyViewpoint actors need to set up some relations between themselves and the default sky portals the previously purely internal 'internal' flag has been exported as a new keyword.
This was done mainly to reduce the amount of occurences of the word FTexture but it immediately helped detect two small and mostly harmless bugs that were found due to the stricter type checks.
Due to how the VM handles default parameters, these must always be identical to the parent to prevent undefined behavior.
So now, if such parameters are encountered, the compiler will either abort (for script version >= 3.3) or print a warning (for older versions.)
Any defaults being specified for older versions will be ignored, though, and the defaults of the parent function be copied to the override.
Due to the special nature of this expression the code generator got stuck in 'address' mode and passed the address of the variable instead of its value.
The order of processing is different here so when the property gets parsed there are no states to delete.
To fix this the property just flags the class and lets the ZScript state compiler deal with this as needed.
The following ill-formed ZScript code might crash targets with sizeof(int) != sizeof(void*) like 64-bit Intel
class test { void func() { if (true) ( return; ) } }