Check object is player before calling QuestGetState()
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@21064 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
fe2b325719
commit
8bab615b69
|
|
@ -22,6 +22,7 @@ import CFDataFile
|
||||||
|
|
||||||
player = Crossfire.WhoIsActivator()
|
player = Crossfire.WhoIsActivator()
|
||||||
|
|
||||||
|
if type(player) == Crossfire.Player:
|
||||||
nobledata = CFDataFile.CFData('scorn_nobility', ['rank', 'title'])
|
nobledata = CFDataFile.CFData('scorn_nobility', ['rank', 'title'])
|
||||||
currentstep = player.QuestGetState("scorn/Aristocracy")
|
currentstep = player.QuestGetState("scorn/Aristocracy")
|
||||||
currentrecord = { '#' : player.Name, 'rank' : currentstep, 'title' : player.Title }
|
currentrecord = { '#' : player.Name, 'rank' : currentstep, 'title' : player.Title }
|
||||||
|
|
@ -35,6 +36,3 @@ else:
|
||||||
Crossfire.Log(Crossfire.LogDebug, "castle_write, updating player %s, old state %s, new state %d" %(player.Name, lastrecord['rank'], currentstep))
|
Crossfire.Log(Crossfire.LogDebug, "castle_write, updating player %s, old state %s, new state %d" %(player.Name, lastrecord['rank'], currentstep))
|
||||||
nobledata.put_record(currentrecord)
|
nobledata.put_record(currentrecord)
|
||||||
player.Message("The castle sage scribbles as you walk past")
|
player.Message("The castle sage scribbles as you walk past")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,9 @@ def handle():
|
||||||
if player.Type != Crossfire.Type.PLAYER:
|
if player.Type != Crossfire.Type.PLAYER:
|
||||||
player = player.Owner
|
player = player.Owner
|
||||||
|
|
||||||
|
if player.Type != Crossfire.Type.PLAYER:
|
||||||
|
return
|
||||||
|
|
||||||
params = Crossfire.ScriptParameters()
|
params = Crossfire.ScriptParameters()
|
||||||
args = params.split()
|
args = params.split()
|
||||||
questname = args[0]
|
questname = args[0]
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,13 @@ player = Crossfire.WhoIsActivator()
|
||||||
params = Crossfire.ScriptParameters()
|
params = Crossfire.ScriptParameters()
|
||||||
args = params.split()
|
args = params.split()
|
||||||
|
|
||||||
questname = args[0]
|
|
||||||
currentstep = player.QuestGetState(questname)
|
|
||||||
|
|
||||||
# by default, forbid applying
|
# by default, forbid applying
|
||||||
Crossfire.SetReturnValue(1)
|
Crossfire.SetReturnValue(1)
|
||||||
|
|
||||||
|
if type(player) == Crossfire.Player:
|
||||||
|
questname = args[0]
|
||||||
|
currentstep = player.QuestGetState(questname)
|
||||||
|
|
||||||
for rule in args[1:]:
|
for rule in args[1:]:
|
||||||
if rule.find("-") == -1:
|
if rule.find("-") == -1:
|
||||||
startstep = int(rule)
|
startstep = int(rule)
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@ def matches(rule):
|
||||||
return True
|
return True
|
||||||
args = rule.split()
|
args = rule.split()
|
||||||
|
|
||||||
|
if type(killer) != Crossfire.Player:
|
||||||
|
return False
|
||||||
|
|
||||||
currentstep = killer.QuestGetState(args[0])
|
currentstep = killer.QuestGetState(args[0])
|
||||||
for rule in args[1:]:
|
for rule in args[1:]:
|
||||||
if rule.find("-") == -1:
|
if rule.find("-") == -1:
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ import Crossfire
|
||||||
item = Crossfire.WhoAmI()
|
item = Crossfire.WhoAmI()
|
||||||
player = Crossfire.WhoIsActivator()
|
player = Crossfire.WhoIsActivator()
|
||||||
args = Crossfire.ScriptParameters().split(' ')
|
args = Crossfire.ScriptParameters().split(' ')
|
||||||
|
if type(player) == Crossfire.Player:
|
||||||
|
questname = args[0]
|
||||||
|
currentstep = player.QuestGetState(questname)
|
||||||
|
|
||||||
questname = args[0]
|
questname = args[0]
|
||||||
stagenumber = int(args[1])
|
stagenumber = int(args[1])
|
||||||
currentstep = player.QuestGetState(questname)
|
currentstep = player.QuestGetState(questname)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue