Skip to content

Commit

Permalink
[MIRROR] fixes runtime when trying to remove a nonexistent source ID …
Browse files Browse the repository at this point in the history
…via RemoveInvisibility() (#2524)

* fixes runtime when trying to remove a nonexistent source ID via RemoveInvisibility() (#83253)

```
[2024-05-15 18:24:21.291] RUNTIME: runtime error: cannot read from list
 - proc name: RemoveInvisibility (/atom/proc/RemoveInvisibility)
 -   source file: code/game/atom/atom_invisibility.dm,66
 -   usr: null
 -   src: the turret (/obj/machinery/porta_turret/ai)
 -   src.loc: the floor (187,33,3) (/turf/open/floor/circuit)
 -   call stack:
 - the turret (/obj/machinery/porta_turret/ai): RemoveInvisibility(/obj/machinery/porta_turret_co... (/obj/machinery/porta_turret_cover))
 - the turret (/obj/machinery/porta_turret_cover): Destroy(0)
 - qdel(the turret (/obj/machinery/porta_turret_cover), 0)
 - the turret (/obj/machinery/porta_turret/ai): atom break("melee")
 - the turret (/obj/machinery/porta_turret/ai): take damage(20, "brute", "melee", 1, 4, 0)
 - the turret (/obj/machinery/porta_turret/ai): take damage(40, "brute", "melee", 1, 4, 0)
 - the turret (/obj/machinery/porta_turret/ai): attack generic(the turret (/mob/living/simple_animal/hostile/mimic/copy/machine), 40, "brute", "melee", 1, 0)
 - the turret (/obj/machinery/porta_turret/ai): attack animal(the turret (/mob/living/simple_animal/hostile/mimic/copy/machine), null)
 - the turret (/mob/living/simple_animal/hostile/mimic/copy/machine): AttackingTarget(the turret (/obj/machinery/porta_turret/ai))
 - the turret (/mob/living/simple_animal/hostile/mimic/copy/machine): AttackingTarget(the turret (/obj/machinery/porta_turret/ai))
 - the turret (/mob/living/simple_animal/hostile/mimic/copy/machine): MeleeAction(1)
 - the turret (/mob/living/simple_animal/hostile/mimic/copy/machine): MoveToTarget(/list (/list))
 - the turret (/mob/living/simple_animal/hostile/mimic/copy/machine): handle automated action()
 - NPC Pool (/datum/controller/subsystem/npcpool): fire(0)
 - NPC Pool (/datum/controller/subsystem/npcpool): ignite(0)
 - Master (/datum/controller/master): RunQueue()
 - Master (/datum/controller/master): Loop(2)
 - Master (/datum/controller/master): StartProcessing(0)
 - 

```

* fixes runtime when trying to remove a nonexistent source ID via RemoveInvisibility()

---------

Co-authored-by: Afevis <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed May 17, 2024
1 parent f0b81b9 commit 69f3f36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/game/atom/atom_invisibility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

/// Removes the specified invisibility source from the tracker
/atom/proc/RemoveInvisibility(id)
if(!invisibility_sources)
if(!invisibility_sources?[id])
return

var/list/priority_data = invisibility_sources[id]
Expand Down

0 comments on commit 69f3f36

Please sign in to comment.