From: Mircea Kitsune Date: Tue, 25 Oct 2011 11:40:39 +0000 (+0300) Subject: Copy / paste: Rename arguments, add proper information messages, and don't allow... X-Git-Tag: xonotic-v0.6.0~35^2~18^2~182 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d450fe0a7586b19c75aeb79fe2c1662cd754bd08;p=xonotic%2Fxonotic-data.pk3dir.git Copy / paste: Rename arguments, add proper information messages, and don't allow pasting objects if the clipboard is empty --- diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 9c32f0ae5..90a3a60b1 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -122,9 +122,9 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) print_to(self, "WARNING: Object could not be removed. Make sure you are facing an object that belongs to you"); return TRUE; } - else if(argv(1) == "duplicate_copy") + else if(argv(1) == "duplicate_object_copy") { - // copies the properties of the selected object to the clipboard + // copies customizable properties of the selected object to the clipboard e = sandbox_EditObject(); // you can only copy objects you can edit, so this works if(e != world) @@ -134,12 +134,21 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) // -------- COPY PROPERTIES -------- print_to(self, "Object copied to clipboard"); + return TRUE; } + + print_to(self, "WARNING: Object could not be copied. Make sure you are facing an object that belongs to you"); return TRUE; } - else if(argv(1) == "duplicate_paste") + else if(argv(1) == "duplicate_object_paste") { - // spawns an object with the properties in the player's clipboard + // spawns a new object using the properties in the player's clipboard + + if(self.clipboard_model == "") // no object in clipboard + { + print_to(self, "WARNING: No object in clipboard. You must copy an object before you can paste it"); + return TRUE; + } e = sandbox_SpawnObject();