mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 10:01:40 +00:00
* tgu * updated paths * updating more paths * master server * more repaths * tgu * oh these were defined * y * tgu * fixes fulp shuttles i think * revert * tgu * fix checks and stuff * Update sound.dm * Update tg_edits.md * tgu
17 lines
761 B
Plaintext
17 lines
761 B
Plaintext
///datum may be null, but it does need to be a typed var
|
|
#define NAMEOF(datum, X) (#X || ##datum.##X)
|
|
|
|
#define VARSET_LIST_CALLBACK(target, var_name, var_value) CALLBACK(GLOBAL_PROC, /proc/___callbackvarset, ##target, ##var_name, ##var_value)
|
|
//dupe code because dm can't handle 3 level deep macros
|
|
#define VARSET_CALLBACK(datum, var, var_value) CALLBACK(GLOBAL_PROC, /proc/___callbackvarset, ##datum, NAMEOF(##datum, ##var), ##var_value)
|
|
|
|
/proc/___callbackvarset(list_or_datum, var_name, var_value)
|
|
if(length(list_or_datum))
|
|
list_or_datum[var_name] = var_value
|
|
return
|
|
var/datum/datum = list_or_datum
|
|
if(IsAdminAdvancedProcCall())
|
|
datum.vv_edit_var(var_name, var_value) //same result generally, unless badmemes
|
|
else
|
|
datum.vars[var_name] = var_value
|