Icemoon Hermit Ruin Active Turf Fix - For Real This Time (#74476)

In #74306, I _thought_ I knew what the cause was, and I both attempted a
potential fix _and_ made tracking it easier. The fruits of my labor paid
off, I know exactly what caused it now.

Basically, the demonic portal will scrape away all turfs in a 5-tile
radius on its `Initialize()`, and if a spawner spawned right next to the
hermit ruin... it would count it as a mineral turf and scrape it away as
well. That's so fucking silly. At least we know now.
## Why It's Good For The Game

The fix is to just make those tiles unscrapeable, which is accomplished
via another turf_flag and filtering those out in the `Initialize()` of
the demonic portals.

I also cleaned up the calls to scrapeaway being `null`, which is really
weird because it just defaulted to the normal proc behavior. Naming the
arguments instead does the same thing (I checked)
This commit is contained in:
san7890
2023-04-04 16:41:32 -04:00
committed by GitHub
parent 4aefba2029
commit 48183ec0ff
5 changed files with 29 additions and 18 deletions
@@ -26,16 +26,16 @@ GLOBAL_LIST_INIT(ore_probability, list(
clear_rock()
/**
* Clears rocks around the spawner when it is created
* Clears rocks around the spawner when it is created. Ignore any rocks that explicitly do not want to be cleared.
*
*/
/obj/structure/spawner/ice_moon/proc/clear_rock()
for(var/turf/F in RANGE_TURFS(2, src))
if(abs(src.x - F.x) + abs(src.y - F.y) > 3)
for(var/turf/potential in RANGE_TURFS(2, src))
if(abs(src.x - potential.x) + abs(src.y - potential.y) > 3)
continue
if(ismineralturf(F))
var/turf/closed/mineral/M = F
M.ScrapeAway(null, CHANGETURF_IGNORE_AIR)
if(ismineralturf(potential) && !(potential.turf_flags & NO_CLEARING))
var/turf/closed/mineral/clearable = potential
clearable.ScrapeAway(flags = CHANGETURF_IGNORE_AIR)
/obj/structure/spawner/ice_moon/deconstruct(disassembled)
destroy_effect()
@@ -67,10 +67,10 @@ GLOBAL_LIST_INIT(ore_probability, list(
mob_types = list(/mob/living/simple_animal/hostile/asteroid/polarbear)
/obj/structure/spawner/ice_moon/polarbear/clear_rock()
for(var/turf/F in RANGE_TURFS(1, src))
if(ismineralturf(F))
var/turf/closed/mineral/M = F
M.ScrapeAway(null, CHANGETURF_IGNORE_AIR)
for(var/turf/potential in RANGE_TURFS(1, src))
if(ismineralturf(potential) && !(potential.turf_flags & NO_CLEARING))
var/turf/closed/mineral/clearable = potential
clearable.ScrapeAway(flags = CHANGETURF_IGNORE_AIR)
/obj/structure/spawner/ice_moon/demonic_portal
name = "demonic portal"
@@ -85,12 +85,12 @@ GLOBAL_LIST_INIT(ore_probability, list(
AddComponent(/datum/component/gps, "Netheric Signal")
/obj/structure/spawner/ice_moon/demonic_portal/clear_rock()
for(var/turf/F in RANGE_TURFS(3, src))
if(abs(src.x - F.x) + abs(src.y - F.y) > 5)
for(var/turf/potential in RANGE_TURFS(3, src))
if(abs(src.x - potential.x) + abs(src.y - potential.y) > 5)
continue
if(ismineralturf(F))
var/turf/closed/mineral/M = F
M.ScrapeAway(null, CHANGETURF_IGNORE_AIR)
if(ismineralturf(potential) && !(potential.turf_flags & NO_CLEARING))
var/turf/closed/mineral/clearable = potential
clearable.ScrapeAway(flags = CHANGETURF_IGNORE_AIR)
/obj/structure/spawner/ice_moon/demonic_portal/destroy_effect()
new /obj/effect/collapsing_demonic_portal(loc)