From: Mircea Kitsune Date: Mon, 24 Oct 2011 13:48:37 +0000 (+0300) Subject: Also prevent spawning objects with an incorrect model. If the file doesn't exist... X-Git-Tag: xonotic-v0.6.0~35^2~18^2~212 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d817905c07fcbd588ad715e32da20367c31b099b;p=xonotic%2Fxonotic-data.pk3dir.git Also prevent spawning objects with an incorrect model. If the file doesn't exist, the player will be notified and the object will not be spawned. --- diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 1e66c9d26..7dada9f1c 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -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; }