Skip to content
EvilDragonfiend edited this page Nov 5, 2024 · 4 revisions

?compile

// file \_DEFINES\_CONST

/datum/const

/// defines a constant value in a safe method (especially for /list)
#define DEFINE__CONST__(const_name, const_val) /datum/_const/var/const_name = const_val
#define CONST(constname) (/datum/const::constname)


#define ITEM_ACID_IMMUNE CONST(ITEM_ACID_IMMUNE)
DEFINE__CONST__(ITEM_ACID_IMMUNE, 1<<0)

DEFINE__CONST__(ITEM_ACID_IMMUNE,	1<<0)
DEFINE__CONST__(ITEM_FIRE_IMMUNE,	1<<1)
DEFINE__CONST__(ITEM_LAVA_IMMUNE,	1<<2)

/datum
	var/list/testlist = list(\
		CONST::ITEM_ACID_IMMUNE, \
		CONST::ITEM_FIRE_IMMUNE, \
		CONST::ITEM_LAVA_IMMUNE)

/proc/main()
	world.log << "all good"
	world.log << CONST::ITEM_ACID_IMMUNE

asd

Clone this wiki locally