]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix some !STRING usage
authorSamual Lenks <samual@xonotic.org>
Fri, 31 May 2013 17:14:42 +0000 (13:14 -0400)
committerSamual Lenks <samual@xonotic.org>
Fri, 31 May 2013 17:14:42 +0000 (13:14 -0400)
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/mutator_superspec.qc
qcsrc/server/mutators/sandbox.qc

index 8daed9205142c77a4556dd196787b140933e448b..342db307880f03c58b7ba11576630e49964d6f7b 100644 (file)
@@ -985,21 +985,22 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag
        flag.nextthink = time + FLAG_THINKRATE;
        flag.ctf_status = FLAG_BASE;
        
-       if(!flag.model) { flag.model = ((teamnumber) ? autocvar_g_ctf_flag_red_model : autocvar_g_ctf_flag_blue_model); }
-       if(!flag.scale) { flag.scale = FLAG_SCALE; }
-       if(!flag.skin) { flag.skin = ((teamnumber) ? autocvar_g_ctf_flag_red_skin : autocvar_g_ctf_flag_blue_skin); }
-       if(!flag.toucheffect) { flag.toucheffect = ((teamnumber) ? "redflag_touch" : "blueflag_touch"); }
-       if(!flag.passeffect) { flag.passeffect = ((teamnumber) ? "red_pass" : "blue_pass"); }
-       if(!flag.capeffect) { flag.capeffect = ((teamnumber) ? "red_cap" : "blue_cap"); }
+       
+       if(flag.model == "")       { flag.model = ((teamnumber) ? autocvar_g_ctf_flag_red_model : autocvar_g_ctf_flag_blue_model); }
+       if(!flag.scale)            { flag.scale = FLAG_SCALE; }
+       if(!flag.skin)             { flag.skin = ((teamnumber) ? autocvar_g_ctf_flag_red_skin : autocvar_g_ctf_flag_blue_skin); }
+       if(flag.toucheffect == "") { flag.toucheffect = ((teamnumber) ? "redflag_touch" : "blueflag_touch"); }
+       if(flag.passeffect == "")  { flag.passeffect = ((teamnumber) ? "red_pass" : "blue_pass"); }
+       if(flag.capeffect == "")   { flag.capeffect = ((teamnumber) ? "red_cap" : "blue_cap"); }
        
        // sound 
-       if(!flag.snd_flag_taken) { flag.snd_flag_taken  = ((teamnumber) ? "ctf/red_taken.wav" : "ctf/blue_taken.wav"); }
-       if(!flag.snd_flag_returned) { flag.snd_flag_returned = ((teamnumber) ? "ctf/red_returned.wav" : "ctf/blue_returned.wav"); }
-       if(!flag.snd_flag_capture) { flag.snd_flag_capture = ((teamnumber) ? "ctf/red_capture.wav" : "ctf/blue_capture.wav"); } // blue team scores by capturing the red flag
-       if(!flag.snd_flag_respawn) { flag.snd_flag_respawn = "ctf/flag_respawn.wav"; } // if there is ever a team-based sound for this, update the code to match.
-       if(!flag.snd_flag_dropped) { flag.snd_flag_dropped = ((teamnumber) ? "ctf/red_dropped.wav" : "ctf/blue_dropped.wav"); }
-       if(!flag.snd_flag_touch) { flag.snd_flag_touch = "ctf/touch.wav"; } // again has no team-based sound
-       if(!flag.snd_flag_pass) { flag.snd_flag_pass = "ctf/pass.wav"; } // same story here
+       if(flag.snd_flag_taken == "")    { flag.snd_flag_taken  = ((teamnumber) ? "ctf/red_taken.wav" : "ctf/blue_taken.wav"); }
+       if(flag.snd_flag_returned == "") { flag.snd_flag_returned = ((teamnumber) ? "ctf/red_returned.wav" : "ctf/blue_returned.wav"); }
+       if(flag.snd_flag_capture == "")  { flag.snd_flag_capture = ((teamnumber) ? "ctf/red_capture.wav" : "ctf/blue_capture.wav"); } // blue team scores by capturing the red flag
+       if(flag.snd_flag_respawn == "")  { flag.snd_flag_respawn = "ctf/flag_respawn.wav"; } // if there is ever a team-based sound for this, update the code to match.
+       if(flag.snd_flag_dropped == "")  { flag.snd_flag_dropped = ((teamnumber) ? "ctf/red_dropped.wav" : "ctf/blue_dropped.wav"); }
+       if(flag.snd_flag_touch == "")    { flag.snd_flag_touch = "ctf/touch.wav"; } // again has no team-based sound
+       if(flag.snd_flag_pass == "")     { flag.snd_flag_pass = "ctf/pass.wav"; } // same story here
        
        // precache
        precache_sound(flag.snd_flag_taken);
index ba70a6cda8a5e301242f978430cf2c82d31a5e95..78d9d707689b5ce2332287daa108aa67e00fa0b2 100644 (file)
@@ -479,7 +479,7 @@ void SpawnBall(void)
 
 //     balls += 4; // using the remaining bits to count balls will leave more than the max edict count, so it's fine
 
-       if(!self.model)
+       if(self.model == "")
        {
                self.model = "models/nexball/ball.md3";
                self.scale = 1.3;
@@ -505,13 +505,13 @@ void SpawnBall(void)
 
        if(!autocvar_g_nexball_sound_bounce)
                self.noise = "";
-       else if(!self.noise)
+       else if(self.noise == "")
                self.noise = "sound/nexball/bounce.wav";
        //bounce sound placeholder (FIXME)
-       if(!self.noise1)
+       if(self.noise1 == "")
                self.noise1 = "sound/nexball/drop.wav";
        //ball drop sound placeholder (FIXME)
-       if(!self.noise2)
+       if(self.noise2 == "")
                self.noise2 = "sound/nexball/steal.wav";
        //stealing sound placeholder (FIXME)
        if(self.noise) precache_sound(self.noise);
@@ -568,7 +568,7 @@ void SpawnGoal(void)
        }
        EXACTTRIGGER_INIT;
        self.classname = "nexball_goal";
-       if(!self.noise)
+       if(self.noise == "")
                self.noise = "ctf/respawn.wav";
        precache_sound(self.noise);
        self.touch = GoalTouch;
@@ -598,7 +598,7 @@ void spawnfunc_nexball_pinkgoal(void)
 void spawnfunc_nexball_fault(void)
 {
        self.team = GOAL_FAULT;
-       if(!self.noise)
+       if(self.noise == "")
                self.noise = "misc/typehit.wav";
        SpawnGoal();
 }
@@ -606,7 +606,7 @@ void spawnfunc_nexball_fault(void)
 void spawnfunc_nexball_out(void)
 {
        self.team = GOAL_OUT;
-       if(!self.noise)
+       if(self.noise == "")
                self.noise = "misc/typehit.wav";
        SpawnGoal();
 }
index a8e442abd390d7189ae6d440fe52b0acc99bbbca..eea3979c44d7f0dc6ea57d7561a99f16aaafac65 100644 (file)
@@ -82,7 +82,7 @@ float superspec_filteritem(entity _for, entity _item)
 {
        float i;
 
-       if(!_for.superspec_itemfilter)
+       if(_for.superspec_itemfilter == "")
                return TRUE;
 
        if(_for.superspec_itemfilter == "")
index cf5d82f87ae4ecf141afd7d80dbbb31af2a07e43..01119829f1dd496d60cc23326258f20a5f6078b9 100644 (file)
@@ -72,7 +72,7 @@ entity sandbox_ObjectEdit_Get(float permissions)
                return world; // entity is not an object
        if(!permissions)
                return trace_ent; // don't check permissions, anyone can edit this object
-       if(!trace_ent.crypto_idfp)
+       if(trace_ent.crypto_idfp == "")
                return trace_ent; // the player who spawned this object did not have an UID, so anyone can edit it
        if not(trace_ent.realowner != self && autocvar_g_sandbox_editor_free < 2)
                return trace_ent; // object does not belong to the player, and players can only edit their own objects on this server
@@ -389,7 +389,7 @@ void sandbox_Database_Load()
                for(;;)
                {
                        file_read = fgets(file_get);
-                       if(!file_read)
+                       if(file_read == "")
                                break;
                        if(substring(file_read, 0, 2) == "//")
                                continue;
@@ -538,7 +538,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                                        return TRUE;
                                                }
                                                self.object_flood = time + autocvar_g_sandbox_editor_flood;
-                                               if(!argv(3)) // 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;
@@ -610,7 +610,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
 
                        // ---------------- COMMAND: OBJECT, EDIT ----------------
                        case "object_edit":
-                               if(!argv(2))
+                               if(argv(2) == "")
                                {
                                        print_to(self, "^1SANDBOX - WARNING: ^7Too few parameters. You must specify a property to edit");
                                        return TRUE;