Wizards can no longer de-jaunt in turfs with dense objects.

Also fixes an exploit where wizards could cast CentCom restricted spells by hiding inside objects, such as lockers or coffins.
This commit is contained in:
PsiOmegaDelta
2015-07-12 14:16:58 +02:00
parent 7a4ed714d2
commit 2ed978b1e1
4 changed files with 24 additions and 6 deletions

View File

@@ -388,3 +388,11 @@
/turf/proc/process() /turf/proc/process()
return PROCESS_KILL return PROCESS_KILL
/turf/proc/contains_dense_objects()
if(density)
return 1
for(var/atom/A in src)
if(A.density && !(A.flags & ON_BORDER))
return 1
return 0

View File

@@ -119,10 +119,8 @@
H << "<span class='warning'>You cannot use your teleporter on this Z-level.</span>" H << "<span class='warning'>You cannot use your teleporter on this Z-level.</span>"
return 0 return 0
for(var/atom/A in T) if(T.contains_dense_objects())
if(A.density && !(A.flags & ON_BORDER)) H << "<span class='warning'>You cannot teleport to a location with solid objects.</span>"
H << "<span class='warning'>You cannot teleport to a location with solid objects.</span>"
return 0
phase_out(H,get_turf(H)) phase_out(H,get_turf(H))
H.loc = T H.loc = T

View File

@@ -189,7 +189,11 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now
if(silenced > 0) if(silenced > 0)
return return
if(user.z == 2 && spell_flags & Z2NOCAST) //Certain spells are not allowed on the centcomm zlevel var/turf/Turf = get_turf(user)
if(!Turf)
user << "<span class='warning'>You cannot cast spells in null space!</span>"
if(spell_flags & Z2NOCAST && (Turf.z in config.admin_levels)) //Certain spells are not allowed on the centcomm zlevel
return 0 return 0
if(spell_flags & CONSTRUCT_CHECK) if(spell_flags & CONSTRUCT_CHECK)

View File

@@ -36,7 +36,7 @@
target.monkeyizing=0 //mob is safely inside holder now, no need for protection. target.monkeyizing=0 //mob is safely inside holder now, no need for protection.
jaunt_steam(mobloc) jaunt_steam(mobloc)
sleep(duration) sleep(duration)
mobloc = get_turf(target.loc) mobloc = holder.last_valid_turf
animation.loc = mobloc animation.loc = mobloc
jaunt_steam(mobloc) jaunt_steam(mobloc)
target.canmove = 0 target.canmove = 0
@@ -75,6 +75,11 @@
var/reappearing = 0 var/reappearing = 0
density = 0 density = 0
anchored = 1 anchored = 1
var/turf/last_valid_turf
/obj/effect/dummy/spell_jaunt/New(var/location)
..()
last_valid_turf = get_turf(location)
/obj/effect/dummy/spell_jaunt/Destroy() /obj/effect/dummy/spell_jaunt/Destroy()
// Eject contents if deleted somehow // Eject contents if deleted somehow
@@ -87,6 +92,9 @@
var/turf/newLoc = get_step(src,direction) var/turf/newLoc = get_step(src,direction)
if(!(newLoc.flags & NOJAUNT)) if(!(newLoc.flags & NOJAUNT))
loc = newLoc loc = newLoc
var/turf/T = get_turf(loc)
if(!T.contains_dense_objects())
last_valid_turf = T
else else
user << "<span class='warning'>Some strange aura is blocking the way!</span>" user << "<span class='warning'>Some strange aura is blocking the way!</span>"
src.canmove = 0 src.canmove = 0