Fix handling in autojail when a player is killed by starvation.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@21519 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
d0debad84d
commit
b5943ff60b
|
|
@ -1,6 +1,7 @@
|
|||
2020-10-20 Daniel Hawkins
|
||||
* scorn/houses/tannery: Fix flagstone tile in entrance area that doesn't prevent casting.
|
||||
* maps/python/quests/QuestAdvance.py: Bail when no player is provided. Avoids a core dump from the attempt to run the script in some scenarios.
|
||||
* maps/python/events/death/autojail.py: Handle player deaths without a killer (e.g. from starvation)
|
||||
|
||||
2020-10-12 Daniel Hawkins
|
||||
* pup_land/begin/adv: Utilize the randomized item generation for the creator arch rather than separate
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# This module will automaticall arrest players killing other players,
|
||||
# provided the option was activated by a DM through 'autojail 1'.
|
||||
# Note the settings defaults to 0 and isn't kept during server resets.
|
||||
# Note the settings defaults to 0 and isn't kept during server resets.
|
||||
|
||||
import Crossfire
|
||||
|
||||
|
|
@ -9,6 +9,11 @@ import Crossfire
|
|||
def check_autojail():
|
||||
killer = Crossfire.WhoIsActivator()
|
||||
|
||||
# If a player dies by starvation, there is no killer.
|
||||
# Bail if that is the case.
|
||||
if killer is None:
|
||||
return
|
||||
|
||||
if killer.Type != Crossfire.Type.PLAYER or killer.DungeonMaster:
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue