ff_u_con_removed
Remove deprecated commands from console.
The following commands are removed:
autosaveinterval
forcesave
load
module
pauseandplay
save
saveandexit
Variables
ENABLE__FF_U_CON_REMOVED: (string) (opt-out) Set to “N” on module to disable unit.
Source code
// @code
#include "ff_i_core"
const string ENABLE__FF_U_CON_REMOVED = "ENABLE__FF_U_CON_REMOVED";
// =============================================================================
void OnConsole()
{
RegisterConsoleCommand("autosaveinterval", __FILE__);
RegisterConsoleCommand("forcesave", __FILE__);
RegisterConsoleCommand("load", __FILE__);
RegisterConsoleCommand("module", __FILE__);
RegisterConsoleCommand("pauseandplay", __FILE__);
RegisterConsoleCommand("save", __FILE__);
RegisterConsoleCommand("saveandexit", __FILE__);
}
// -----------------------------------------------------------------------------
void main()
{
if (!GetModuleFlag(ENABLE__FF_U_CON_REMOVED, TRUE))
return;
string sEvent = GetCurrentEvent();
if (sEvent == ON_REGISTER)
OnConsole();
else if (
sEvent == GetConsoleEventName("autosaveinterval") ||
sEvent == GetConsoleEventName("forcesave") ||
sEvent == GetConsoleEventName("load") ||
sEvent == GetConsoleEventName("module") ||
sEvent == GetConsoleEventName("pauseandplay") ||
sEvent == GetConsoleEventName("save") ||
sEvent == GetConsoleEventName("saveandexit")
)
{
string sCommand = GetLocalString(GetModule(), CONSOLE_COMMAND);
NWNX_Util_RawPrint("error: " + sCommand + " not understood");
}
}