Polaris
Polaris copied to clipboard
Changes alien_whitelist to an assoc list of ckeys
This makes me sad:
This change maybe addresses that? It can't be slower.
Parsing it all once at load to (like the PR name, before the regex add) a structure like list(ckey = list(name, name, ...), ...)
may be preferable in the end, since then the matter of is_alien_whitelisted reduces to just
.../is_alien_whitelisted(mob/M, species/S)
return (S?.name in alien_whitelist?[ckey(M?.ckey)])
(which is terribly resilient to nulls, as an aside)
nb: because this uses the single monolithic file approach, the regex the whole thing
or pre-parse the whole thing
approaches are necessary. Were it sqlite, json-per-user in player_saves, or some other oob store, you could load the data per-client, reducing work and making in-game editing of allow lists more reasonable.
(this is not directly PR relevant ofc; musings for a potential future redo)
Closing this since you already put in an alternative. Reopen if necessary.