Adds a couple of absent turf nullchecks (#89733)

## About The Pull Request

Fixes a handful of minor misc issues detected while trying to break
#89591

These are basically summed up as:
- check_teleport_valid (used in a couple of places) never actually
nullchecked the destination then runtimes later if it is null. We'd
rather it just returns false if you're trying to teleport to nowhere I
think.
- Warp Cubes (a mining item) did something similar if one of them ended
up in nullspace somehow.
- AI controllers in nullspace would runtime repeatedly while trying to
check their Z level, we never want an AI controller to be awake in
nullspace so we'll just tell them to shut off in there.

Sometimes items and mobs go to nullspace for holding reasons, but I
don't think any of these were commonly encountered issues.

## Changelog

🆑
fix: The Warp Cube will now fail if it tries to teleport you to nowhere,
instead of turning you blue and then failing
/🆑

I don't know if the other ones were actually player facing they just
runtimed
This commit is contained in:
Jacquerel
2025-03-01 13:09:08 +00:00
committed by GitHub
parent bcb4f1f5b2
commit 5a6d0f9373
3 changed files with 7 additions and 2 deletions

View File

@@ -210,6 +210,9 @@
/// Validates that the teleport being attempted is valid or not
/proc/check_teleport_valid(atom/teleported_atom, atom/destination, channel, atom/original_destination = null)
if(isnull(destination))
return FALSE // Teleporting FROM nullspace is fine, but TO nullspace is not
var/area/origin_area = get_area(teleported_atom)
var/turf/origin_turf = get_turf(teleported_atom)