Skip to content

Commit 2bdb202

Browse files
LikeLakers2GhommieMrMelbert
authored
[PORT] Fixing two fishing issues in one PR. (#5532)
## About The Pull Request This PR partially ports the following PR from tgstation: * tgstation/tgstation#86042 This should fix <#5520>. Mobs who drop into a chasm in a virtual domain will no longer be retrievable. This also incidentally splits up the "chasm fallen mob" list into different z-level categories - meaning that mobs which fall in chasms at centcom can't be retrieved from a chasm on the station; simultaneously, mobs who fall into a station-side chasm can be retrieved from any station chasm. The PR was not fully ported - part of it relied on changes made in <tgstation/tgstation#80599>, which is a balance change that has not been ported yet. (Included so Github marks this as fixing an issue) ## Why It's Good For The Game Fixes #5520 ## Changelog :cl:MichiRecRoom, Ghommie fix: (Ghommie) Fixed a few harddel issues with mob spawns that caused charred corpses fished from lavaland to create an invisible blockade. fix: (Ghommie) Fixed being able to fish up mobs that have fallen in totally different z-levels with a rescue hook (i.e. from bitrunning domains to lavaland). /:cl: Co-authored-by: Ghom <[email protected]> Co-authored-by: MrMelbert <[email protected]>
1 parent 5078fb8 commit 2bdb202

File tree

3 files changed

+48
-4
lines changed

3 files changed

+48
-4
lines changed

code/datums/components/chasm.dm

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,51 @@ GLOBAL_LIST_EMPTY(chasm_fallen_mobs)
245245
/obj/effect/abstract/chasm_storage/Entered(atom/movable/arrived)
246246
. = ..()
247247
if(isliving(arrived))
248+
//Mobs that have fallen in reserved area should be deleted to avoid fishing stuff from the deathmatch or VR.
249+
if(is_reserved_level(loc.z) && !istype(get_area(loc), /area/shuttle))
250+
qdel(arrived)
251+
return
248252
RegisterSignal(arrived, COMSIG_LIVING_REVIVE, PROC_REF(on_revive))
249-
GLOB.chasm_fallen_mobs += arrived
253+
LAZYADD(GLOB.chasm_fallen_mobs[get_chasm_category(loc)], arrived)
250254

251255
/obj/effect/abstract/chasm_storage/Exited(atom/movable/gone)
252256
. = ..()
253257
if(isliving(gone))
254258
UnregisterSignal(gone, COMSIG_LIVING_REVIVE)
255-
GLOB.chasm_fallen_mobs -= gone
259+
LAZYREMOVE(GLOB.chasm_fallen_mobs[get_chasm_category(loc)], gone)
260+
261+
/obj/effect/abstract/chasm_storage/on_changed_z_level(turf/old_turf, turf/new_turf, same_z_layer, notify_contents)
262+
. = ..()
263+
var/old_cat = get_chasm_category(old_turf)
264+
var/new_cat = get_chasm_category(new_turf)
265+
var/list/mobs = list()
266+
for(var/mob/fallen in src)
267+
mobs += fallen
268+
LAZYREMOVE(GLOB.chasm_fallen_mobs[old_cat], mobs)
269+
LAZYADD(GLOB.chasm_fallen_mobs[new_cat], mobs)
270+
271+
/**
272+
* Returns a key to store, remove and access fallen mobs depending on the z-level.
273+
* This stops rescuing people from places that are waaaaaaaay too far-fetched.
274+
*/
275+
/proc/get_chasm_category(turf/turf)
276+
var/z_level = turf?.z
277+
var/area/area = get_area(turf)
278+
if(istype(area, /area/shuttle)) //shuttle move between z-levels, so they're a special case.
279+
return area
280+
281+
if(is_away_level(z_level))
282+
return ZTRAIT_AWAY
283+
if(is_mining_level(z_level))
284+
return ZTRAIT_MINING
285+
if(is_station_level(z_level))
286+
return ZTRAIT_STATION
287+
if(is_centcom_level(z_level))
288+
return ZTRAIT_CENTCOM
289+
if(is_reserved_level(z_level))
290+
return ZTRAIT_RESERVED
291+
292+
return ZTRAIT_SPACE_RUINS
256293

257294
#define CHASM_TRAIT "chasm trait"
258295
/**

code/modules/fishing/fish/chasm_detritus.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ GLOBAL_LIST_INIT_TYPED(chasm_detritus_types, /datum/chasm_detritus, init_chasm_d
9393
/// This also includes all mobs fallen into chasms, regardless of distance
9494
/datum/chasm_detritus/restricted/bodies/get_chasm_contents(turf/fishing_spot)
9595
. = ..()
96-
. |= GLOB.chasm_fallen_mobs
96+
. |= GLOB.chasm_fallen_mobs[get_chasm_category(fishing_spot)]
9797

9898
/// Body detritus is selected in favor of bodies belonging to sentient mobs
9999
/// The first sentient body found in the list of contents is returned, otherwise

code/modules/mob_spawn/mob_spawn.dm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
if(faction)
3939
faction = string_list(faction)
4040

41+
/obj/effect/mob_spawn/Destroy()
42+
spawned_mob_ref = null
43+
if(istype(outfit))
44+
QDEL_NULL(outfit)
45+
return ..()
46+
4147
/// Creates whatever mob the spawner makes. Return FALSE if we want to exit from here without doing that, returning NULL will be logged to admins.
4248
/obj/effect/mob_spawn/proc/create(mob/mob_possessor, newname, is_pref_loaded)
4349
var/mob/living/spawned_mob = new mob_type(get_turf(src)) //living mobs only
@@ -155,7 +161,7 @@
155161
SSpoints_of_interest.make_point_of_interest(src)
156162
LAZYADD(GLOB.mob_spawners[name], src)
157163

158-
/obj/effect/mob_spawn/Destroy()
164+
/obj/effect/mob_spawn/ghost_role/Destroy()
159165
var/list/spawners = GLOB.mob_spawners[name]
160166
LAZYREMOVE(spawners, src)
161167
if(!LAZYLEN(spawners))
@@ -310,6 +316,7 @@
310316

311317
///these mob spawn subtypes trigger immediately (New or Initialize) and are not player controlled... since they're dead, you know?
312318
/obj/effect/mob_spawn/corpse
319+
density = FALSE //these are pretty much abstract objects that leave a corpse in their place.
313320
///when this mob spawn should auto trigger.
314321
var/spawn_when = CORPSE_INSTANT
315322

0 commit comments

Comments
 (0)