me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Remove *"), '0 0 0', "sandbox object_remove", 0));
me.TDempty(me, 0.1);
me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Copy *"), '0 0 0', "sandbox object_duplicate copy cl_sandbox_clipboard", 0));
- me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Paste"), '0 0 0', "sandbox object_duplicate paste", 0));
+ me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Paste"), '0 0 0', "sandbox object_duplicate paste \"$cl_sandbox_clipboard\"", 0));
me.TR(me);
me.TD(me, 1, 0.25, e = makeXonoticTextLabel(0, _("Bone:")));
me.TD(me, 1, 1.5, box = makeXonoticInputBox(1, "menu_sandbox_attach_bone"));
const float MAX_STORAGE_ATTACHMENTS = 16;
float object_count;
-.string object_clipboard;
.entity object_attach;
.string material;
case "paste":
// spawns a new object using the properties in the player's clipboard
- if(!self.object_clipboard) // no object in clipboard
+ if(!argv(3)) // no object in clipboard
{
print_to(self, "^1SANDBOX - WARNING: ^7No object in clipboard. You must copy an object before you can paste it");
return TRUE;
return TRUE;
}
- e = sandbox_ObjectPort_Load(self.object_clipboard, FALSE);
+ e = sandbox_ObjectPort_Load(argv(3), FALSE);
print_to(self, "^2SANDBOX - INFO: ^7Object pasted successfully");
if(autocvar_g_sandbox_info > 0)
return FALSE;
}
-MUTATOR_HOOKFUNCTION(sandbox_ClientDisconnect)
-{
- // unzone the player's clipboard if it's not empty
- if(self.object_clipboard)
- {
- strunzone(self.object_clipboard);
- self.object_clipboard = string_null;
- }
-
- return FALSE;
-}
-
float autosave_time;
MUTATOR_HOOKFUNCTION(sandbox_StartFrame)
{
MUTATOR_HOOK(SV_ParseClientCommand, sandbox_PlayerCommand, CBC_ORDER_ANY);
MUTATOR_HOOK(SV_StartFrame, sandbox_StartFrame, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerPreThink, sandbox_PlayerPreThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, sandbox_ClientDisconnect, CBC_ORDER_ANY);
MUTATOR_ONADD
{