Add Alchemy's /sethome command

This commit is contained in:
Liru Færs
2020-01-05 23:27:51 -05:00
parent 27033f4ebb
commit a7cba5f1a3
2 changed files with 17 additions and 0 deletions

View File

@@ -157,6 +157,17 @@
<key>Value</key>
<string>/setchannel</string>
</map>
<key>AlchemyChatCommandSetHome</key>
<map>
<key>Comment</key>
<string>Command to set the avatar home</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>/sethome</string>
</map>
<key>AlchemyConnectToNeighbors</key>
<map>
<key>Comment</key>

View File

@@ -255,6 +255,7 @@ bool cmd_line_chat(std::string data, EChatType type)
static LLCachedControl<std::string> sPosCommand(gSavedSettings, "AscentCmdLinePos");
static LLCachedControl<std::string> sRezPlatCommand(gSavedSettings, "AscentCmdLineRezPlatform");
static LLCachedControl<std::string> sHomeCommand(gSavedSettings, "AscentCmdLineTeleportHome");
static LLCachedControl<std::string> sSetHomeCommand(gSavedSettings, "AlchemyChatCommandSetHome", "/sethome");
static LLCachedControl<std::string> sCalcCommand(gSavedSettings, "AscentCmdLineCalc");
static LLCachedControl<std::string> sMapToCommand(gSavedSettings, "AscentCmdLineMapTo");
static LLCachedControl<std::string> sClearCommand(gSavedSettings, "AscentCmdLineClearChat");
@@ -365,6 +366,11 @@ bool cmd_line_chat(std::string data, EChatType type)
gAgent.teleportHome();
return false;
}
else if (cmd == utf8str_tolower(sSetHomeCommand)) // sethome
{
gAgent.setStartPosition(START_LOCATION_ID_HOME);
return false;
}
else if (cmd == utf8str_tolower(sCalcCommand))//Cryogenic Blitz
{
if (data.length() > cmd.length() + 1)