More portal fixes

This commit is contained in:
Mark van Alphen
2019-06-03 21:57:00 +02:00
parent cd362d6bad
commit 950a4cb5dc
7 changed files with 37 additions and 31 deletions
+9 -5
View File
@@ -81,17 +81,17 @@
/obj/effect/portal/proc/teleport(atom/movable/M, force = FALSE)
if(!istype(M))
return
return FALSE
if(iseffect(M) || !M.simulated)
return
if(!M.simulated || iseffect(M))
return FALSE
if(M.anchored && ismecha(M))
return
return FALSE
if(!target)
qdel(src)
return
return FALSE
if(ismegafauna(M))
message_admins("[M] has used a portal at [ADMIN_VERBOSEJMP(src)] made by [key_name_admin(usr)].")
@@ -100,9 +100,13 @@
icon_state = fail_icon
if(!do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to deep space.
invalid_teleport()
return FALSE
else
if(!do_teleport(M, target, precision, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to a turf adjacent to target.
invalid_teleport()
return FALSE
return TRUE
/obj/effect/portal/proc/invalid_teleport()
visible_message("<span class='warning'>[src] flickers and fails due to bluespace interference!</span>")
+1 -1
View File
@@ -75,7 +75,7 @@
return FALSE
if(!isliving(AM) && !isobj(AM))
return FALSE
if(is_type_in_typecache(AM, forbidden_types) || !AM.simulated || AM.throwing)
if(!AM.simulated || is_type_in_typecache(AM, forbidden_types) || AM.throwing)
return FALSE
//Flies right over the chasm
if(isliving(AM))
+1 -1
View File
@@ -88,7 +88,7 @@
/turf/space/transit/Entered(atom/movable/AM, atom/OldLoc, ignoreRest = 0)
if(!AM)
return
if(istype(AM, /obj/docking_port) || !AM.simulated)
if(!AM.simulated || istype(AM, /obj/docking_port))
return //this was fucking hilarious, the docking ports were getting thrown to random Z-levels
var/max = world.maxx-TRANSITIONEDGE
var/min = 1+TRANSITIONEDGE
@@ -173,10 +173,10 @@ var/sc_safecode5 = "[rand(0,9)]"
mezzer()
/obj/singularity/narsie/sc_Narsie/consume(var/atom/A)
if(is_type_in_list(A, uneatable))
return FALSE
if(!A.simulated)
return FALSE
if(is_type_in_list(A, uneatable))
return FALSE
if(istype(A,/mob/living))
var/mob/living/L = A
L.gib()
+21 -19
View File
@@ -34,7 +34,6 @@
qdel(O)
wormholes.Cut()
/obj/effect/portal/wormhole
name = "wormhole"
desc = "It looks highly unstable; It could close at any moment."
@@ -42,23 +41,26 @@
icon_state = "anom"
failchance = 0
/obj/effect/portal/wormhole/attack_hand(mob/user)
teleport(user)
/obj/effect/portal/wormhole/attackby(obj/item/I, mob/user, params)
teleport(user)
/obj/effect/portal/wormhole/teleport(atom/movable/M)
if(istype(M, /obj/effect)) //sparks don't teleport
return
if(M.anchored && istype(M, /obj/mecha))
return
if(!istype(M))
return FALSE
if(istype(M, /atom/movable))
var/turf/target
if(GLOB.portals.len)
var/obj/effect/portal/P = pick(GLOB.portals)
if(P && isturf(P.loc))
target = P.loc
if(!target) return
do_teleport(M, target, 1, 1, 0, 0) ///You will appear adjacent to the beacon
if(!M.simulated || iseffect(M))
return FALSE
if(M.anchored && ismecha(M))
return FALSE
var/turf/target
if(GLOB.portals.len)
var/obj/effect/portal/P = pick(GLOB.portals)
if(P && isturf(P.loc))
target = P.loc
if(!target)
return FALSE
if(!do_teleport(M, target, 1, TRUE)) ///You will appear adjacent to the beacon
return FALSE
return TRUE
+1 -1
View File
@@ -60,7 +60,7 @@
for(var/atom/A in T.contents)
if(!A.simulated)
continue
if(istype(A,/obj/machinery/light))
if(istype(A, /obj/machinery/light))
continue //hacky but whatever, shuttles need three spots each for this shit
contcount++
+2 -2
View File
@@ -138,10 +138,10 @@
if(!AM)
return FALSE
if(is_type_in_list(AM, blacklist))
if(!AM.simulated)
return FALSE
if(!AM.simulated)
if(is_type_in_list(AM, blacklist))
return FALSE
if(AM.anchored)