Terasology / LightAndShadow

Light & Shadow is an experimental game type set in a quirky Alice in Wonderland inspired setting
Apache License 2.0
8 stars 22 forks source link

fix: prevent npe on player death by thrown spear #254

Closed skaldarnar closed 2 years ago

skaldarnar commented 2 years ago

Combat system may assign null as instigator to some (Before)DestroyEvents which causes an NPE in the player death system.

This fixes the crash with a TODO item to find and fix the root cause. See https://github.com/Terasology/CombatSystem/pull/92 for first investigation results.

In addition, this commit introduces an enum for the statistics type to update to avoid any bugs resulting from using plain string "constants" (we did not even use constants ...).

Furthermore, I've made the pre-game countdown a constant. This should make it easier to find this value and adjust it later, e.g., for local testing or tweaking.