1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Client::Interact: Use InteractAction enum instead of numeric constants

This replaces the magic numbers used as interaction modes both client-side and server-side, primarily for the sake of ease-of-readability.
This commit is contained in:
ANAND 2019-08-04 10:23:59 +05:30 committed by SmallJoker
parent e462a9a5ef
commit e788ee283f
5 changed files with 59 additions and 60 deletions

View file

@ -954,10 +954,20 @@ enum CSMRestrictionFlags : u64 {
// When those are complete, this should return to only being a restriction on the
// loading of client mods.
CSM_RF_LOAD_CLIENT_MODS = 0x00000001, // Don't load client-provided mods or 'builtin'
CSM_RF_CHAT_MESSAGES = 0x00000002, // Disable chat message sending from CSM
CSM_RF_READ_ITEMDEFS = 0x00000004, // Disable itemdef lookups
CSM_RF_READ_NODEDEFS = 0x00000008, // Disable nodedef lookups
CSM_RF_LOOKUP_NODES = 0x00000010, // Limit node lookups
CSM_RF_READ_PLAYERINFO = 0x00000020, // Disable player info lookups
CSM_RF_CHAT_MESSAGES = 0x00000002, // Disable chat message sending from CSM
CSM_RF_READ_ITEMDEFS = 0x00000004, // Disable itemdef lookups
CSM_RF_READ_NODEDEFS = 0x00000008, // Disable nodedef lookups
CSM_RF_LOOKUP_NODES = 0x00000010, // Limit node lookups
CSM_RF_READ_PLAYERINFO = 0x00000020, // Disable player info lookups
CSM_RF_ALL = 0xFFFFFFFF,
};
enum InteractAction : u8
{
INTERACT_START_DIGGING, // 0: start digging (from undersurface) or use
INTERACT_STOP_DIGGING, // 1: stop digging (all parameters ignored)
INTERACT_DIGGING_COMPLETED, // 2: digging completed
INTERACT_PLACE, // 3: place block or item (to abovesurface)
INTERACT_USE, // 4: use item
INTERACT_ACTIVATE // 5: rightclick air ("activate")
};