Don't cause an exception if it is not a player triggering.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@14561 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
68094029af
commit
32553f2342
|
@ -29,19 +29,23 @@
|
|||
|
||||
import Crossfire
|
||||
|
||||
player = Crossfire.WhoIsActivator()
|
||||
event = Crossfire.WhatIsEvent()
|
||||
params = Crossfire.ScriptParameters()
|
||||
args = params.split()
|
||||
questname = args[0]
|
||||
currentstep = player.QuestGetState(questname)
|
||||
condition = args[1]
|
||||
if condition.find("-") == -1:
|
||||
startstep = int(condition)
|
||||
endstep = startstep
|
||||
else:
|
||||
startstep = int(condition.split("-")[0])
|
||||
endstep= int(condition.split("-")[1])
|
||||
if currentstep >= startstep and currentstep <= endstep:
|
||||
Crossfire.Log(Crossfire.LogDebug, "QuestTriggerConnect.py: triggering connection number %s." % args[2])
|
||||
player.Map.TriggerConnected(int(args[2]), 1, player)
|
||||
def trigger():
|
||||
player = Crossfire.WhoIsActivator()
|
||||
if player.Type != Crossfire.Type.PLAYER:
|
||||
return;
|
||||
params = Crossfire.ScriptParameters()
|
||||
args = params.split()
|
||||
questname = args[0]
|
||||
currentstep = player.QuestGetState(questname)
|
||||
condition = args[1]
|
||||
if condition.find("-") == -1:
|
||||
startstep = int(condition)
|
||||
endstep = startstep
|
||||
else:
|
||||
startstep = int(condition.split("-")[0])
|
||||
endstep= int(condition.split("-")[1])
|
||||
if currentstep >= startstep and currentstep <= endstep:
|
||||
Crossfire.Log(Crossfire.LogDebug, "QuestTriggerConnect.py: triggering connection number %s." % args[2])
|
||||
player.Map.TriggerConnected(int(args[2]), 1, player)
|
||||
|
||||
trigger()
|
||||
|
|
Loading…
Reference in New Issue