-
Notifications
You must be signed in to change notification settings - Fork 18
/
quit.c
45 lines (39 loc) · 1.28 KB
/
quit.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//*****************************************************************************
// Copyright (c) 2018 - Allen Cummings, RealmsMUD, All rights reserved. See
// the accompanying LICENSE file for details.
//*****************************************************************************
inherit "/lib/commands/baseCommand.c";
/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
{
if (!arg)
{
addCommandTemplate("quit");
}
}
/////////////////////////////////////////////////////////////////////////////
public nomask int execute(string command, object initiator)
{
int ret = 0;
if (canExecuteCommand(command))
{
ret = 1;
tell_object(initiator, "Saving character...\n");
initiator->save();
object *items = deep_inventory(initiator);
if (sizeof(items))
{
foreach(object item in items)
{
destruct(item);
}
}
tell_object(initiator, "We hope you enjoyed your time here. Come back soon!\n");
if (!initiator->Invisibility())
{
say(sprintf("%s left the game.\n", capitalize(initiator->RealName())));
}
destruct(initiator);
}
return ret;
}