Some improvement to the teleport scroll and spell code. It unbuckles the user now.

Thanks to Nodrak~

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5565 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
aranclanos@hotmail.com
2013-01-17 06:22:29 +00:00
parent 1f07f31b64
commit a8cb1dc4f8
2 changed files with 27 additions and 8 deletions

View File

@@ -46,11 +46,20 @@
usr <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry."
return
var/attempt = 0
if(target && target.buckled)
target.buckled.unbuckle()
var/list/tempL = L
var/attempt = null
var/success = 0
while(!success)
success = target.Move(pick(L))
if(attempt > 20) break //Failsafe
while(tempL.len)
attempt = pick(tempL)
success = target.Move(attempt)
if(!success)
tempL.Remove(attempt)
else
break
if(!success)
target.loc = pick(L)

View File

@@ -69,12 +69,22 @@
user <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry."
return
var/attempt = 0
if(user && user.buckled)
user.buckled.unbuckle()
var/list/tempL = L
var/attempt = null
var/success = 0
while(!success)
success = user.Move(pick(L))
if(attempt > 20) break //Failsafe
while(tempL.len)
attempt = pick(tempL)
success = user.Move(attempt)
if(!success)
tempL.Remove(attempt)
else
break
if(!success)
user.loc = pick(L)
smoke.start()
src.uses -= 1