Files
Lucy ccea3ccf30 fix a hard delete with loot panels (#96349)
## About The Pull Request

fixes `/datum/lootpanel` not being removed from SSlooting's
backlog/processing when destroyed.

another native reftracker W

```
[2026-06-04 15:54:59.739] REFSCANNER: native refscan complete for /datum/lootpanel ([0x21068f2e]), took 942 ms
 - === 2 finding(s)===
 - [list]       list #5085 [index 0] (len=1, refs=1)
 - [list_owner] datum #1977 (/datum/controller/subsystem/looting).processing -> list #5085
```

also fixed a bug where SSlooting wouldn't really process after `backlog`
was moved to `processing`.

## Why It's Good For The Game

hard delete bad

## Changelog

no player-facing changes
2026-06-06 18:24:45 +02:00

41 lines
938 B
Plaintext

/// Queues image generation for search objects without icons
SUBSYSTEM_DEF(looting)
name = "Loot Icon Generation"
ss_flags = SS_NO_INIT
priority = FIRE_PRIORITY_PROCESS
runlevels = RUNLEVEL_LOBBY|RUNLEVELS_DEFAULT
wait = 0.5 SECONDS
/// Backlog of items. Gets put into processing
var/list/datum/lootpanel/backlog = list()
/// Actively processing items
var/list/datum/lootpanel/processing = list()
/datum/controller/subsystem/looting/stat_entry(msg)
msg = "P:[length(backlog)]"
return ..()
/datum/controller/subsystem/looting/fire(resumed)
if(!length(backlog) && !length(processing))
return
if(!resumed)
processing = backlog
backlog = list()
while(length(processing))
var/datum/lootpanel/panel = processing[length(processing)]
if(QDELETED(panel) || !length(panel.to_image))
processing.len--
continue
if(!panel.process_images())
backlog += panel
if(MC_TICK_CHECK)
return
processing.len--