Improve efficiency in FIRE logic, it no longer runs the check multiple times for each surrounding particle. RNG chances reduced accordingly.
Remove unnecessary code in init_can_move
Set Weight to 100, which is the proper max for weight
This is very similar to the SPRK-PROT bug (fixed by 4aa58d6c)
in that the cause for a later crash is the free list of particles
being corrupted by messing with the .life property of a dead
particle.
The code in the loop body following this kill_part call has no
effect on other particles if the call were to happen. The only
thing this continue skips is increasing pressure under the now
dead particle.
Credit goes to @QuanTech for finding the problem, see id:2547788
(originally his save, I just saved to my alt account for future
reference).
This fixes the only valid bug on the "Glitches" wiki page. All the rest were already fixed (multi-head stkm) or are not bugs (lava ice, "destroying" dmnd with dray)
Used in create_part, kill_part, and part_change_type, allows us to remove element-specific stuff in those functions
Note: difference between Create and ChangeType is that Create is called when we want to initialize default element properties, but ChangeType is called every time a particle is changed to that type, even if it doesn't need default properties set. ChangeType is mainly used for things that need accurate state tracking, like the stkm spawn status.
ChangeType is called every time a particle is changed to or from its type, which includes if the particle is deleted, and also Lua.
Neither of these functions are called when loading saves, that's probably an oversight, will fix later
Most of the switch statement in create_part is gone. There's a few others that I will get rid of in future commits. There will also be a CreateAllowed function, and a ChangeType. ChangeType will handle stuff that is duplicated in both create_part and part_change_type. Considering making a Destroy function instead of ChangeType, though.
Later on, Lua events will be made for all 3
Credit to jacksonmj for the original design of all of this, I copied it into my mod years ago
The rest will will in a commit soon that adds the Create event and some other stuff
Lua events will come after that
PLSM default temp lowered to MAX_TEMP