mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user