Also prevent spawning objects with an incorrect model. If the file doesn't exist...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 13:48:37 +0000 (16:48 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 13:48:37 +0000 (16:48 +0300)
qcsrc/server/mutators/sandbox.qc

index 1e66c9d26d9d98642d73b2d8ec87391a7a7af6bf..7dada9f1c0f2673aeb4a321d9803d4da6914cf9d 100644 (file)
@@ -20,10 +20,15 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                {
                        // spawn a new object with the default settings
 
+                       // don't allow spawning objects without a model
                        if(cmd_argc < 3)
                        {
-                               // don't allow spawning objects without a model
-                               print_to(self, "WARNING: Attempted to spawn an object without a model. Please specify the path to your mesh after the 'spawn' command");
+                               print_to(self, "WARNING: Attempted to spawn an object without specifying a model. Please specify the path to your model file after the 'spawn' command");
+                               return TRUE;
+                       }
+                       else if not(fexists(argv(2)))
+                       {
+                               print_to(self, "WARNING: Attempted to spawn an object with a non-existent model. Make sure the path to your model file is correct");
                                return TRUE;
                        }