Since actors are being spawned before the renderer gets set up this needs to fully initialize the list before spawning the actors, then take it down again for creating the vertex buffer and then recreate it.
- TriggerPainChance(Name mod, bool forcedPain)
- One exception: PainThrehold is only checked in ReactToDamage, since this function does not require checking damage amount.
- Split off all reactive functionality (pain, infighting, etc) into its own function, ReactToDamage.
- Refactored all DamageMobj's damage <= 0 values.
- Any unconditional cancellations now return -1. ReactToDamage will not be called if values < 0.
- All pain/wound/target changing allowances return 0.
NOFRICTION disables all friction effects on the thing it's set on
(including the speed cap from water/crouching), and NOFRICTIONBOUNCE
disables the "bounce off walls on an icy floor" effect on the thing
it's set on.
This did no longer sort sprites in the same position reliably since the feature to render sprites which only partially are inside a sector was added.
With this, sprites in the same position are no longer guaranteed to be added to the render list in sequence.
Fixed by adding an 'order' field to AActor which gets incremented with each spawned actor and reset when a new level is started.
The software renderer will also need a variation of this fix but its data no longer has access to the defining actor when being sorted, so a bit more work is needed here.
# Conflicts:
# src/hwrenderer/scene/hw_drawlist.cpp
# src/hwrenderer/scene/hw_sprites.cpp
Unlike everything else from the IWADs this had to use the 'light' keyword in ZScript because this is merely a base class for many others and the light definitions here need to be inheritable.
Many uses of random() & value have been turned into random(0, value).
This is not only more efficient, it also ensures better random distribution because the parameter-less variant only returns values between 0 and 255.
Changed to use 32 bit and also fixed the random number call which was using the byte value variant of the access operator, effectively limiting the number of choices to 256.
The mod which prompted me to add this is "The Chosen" which is a Dehacked-based TC and repurposes many original actors for something entirely different.
The stock lights are not usable for this and would make it impossible to add a GAMEINFO lump to it because then there is no way to disable loading of lights in the startup screen.