// Master config for managing various command aliases and settings
// =================================================================
-// Execute commands based on whether it is dedicated a server or a client.
-alias "_detect_dedicated_$qport" "${* asis}"
+// create if_client and if_dedicated aliases that allow executing commands based on
+// whether it is a dedicated server or a client
+alias _def_detect_dedicated "alias _detect_dedicated_${qport ?} \"\""
+_def_detect_dedicated
+alias "_detect_dedicated_" "${* asis}"
+alias "_detect_dedicated_${qport ?}" "${* asis}"
alias "_detect_dedicated_0" ""
-alias _if_dedicated "_detect_dedicated_$qport ${* asis}"
+alias _if_dedicated "_detect_dedicated_${qport ?} ${* asis}"
alias if_client "${* asis}"
alias if_dedicated "${* asis}"
_if_dedicated alias if_client ""
if_client alias if_dedicated ""
+// these aliases are now useless, remove them
+// NOTE for some reason _detect_dedicated_ no longer exists in dedicated
+unalias _def_detect_dedicated
+if_client unalias "_detect_dedicated_"
+unalias "_detect_dedicated_${qport ?}"
+unalias _detect_dedicated_0
+unalias _if_dedicated
+
// for easy access by QC
if_dedicated set is_dedicated 1
if_client set is_dedicated 0