]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix some !string uses
authorRudolf Polzer <divverent@xonotic.org>
Thu, 3 Jan 2013 20:27:37 +0000 (21:27 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 3 Jan 2013 20:27:37 +0000 (21:27 +0100)
qcsrc/common/net_notice.qc
qcsrc/server/cl_client.qc
qcsrc/server/command/vote.qc
qcsrc/server/domination.qc
qcsrc/server/g_triggers.qc
qcsrc/server/ipban.qc
qcsrc/server/item_key.qc
qcsrc/server/t_items.qc
qcsrc/server/t_plats.qc

index 6d786fb69109ba1871e9e38fee717af5465e48f2..625e091dcc68994ca9a3e5bdd8f4a327f3a1cff9 100644 (file)
@@ -15,7 +15,7 @@ void sv_notice_join_think()
 void sv_notice_join()
 {
     // to-do: make sv_join_notices support per-entry times
-    if(!autocvar_sv_join_notices || autocvar_sv_join_notices == "")      
+    if(autocvar_sv_join_notices == "")
         return;
 
     entity n = spawn();
index 4f5671df082117db61307d639106d9756dbe4976..165460eeb2ae3ad678729611f873f927c7f65cb9 100644 (file)
@@ -3075,7 +3075,7 @@ void PlayerPostThink (void)
 
        if((g_cts || g_race) && self.cvar_cl_allow_uidtracking == 1 && self.cvar_cl_allow_uid2name == 1)
        {
-               if(!self.stored_netname)
+               if not(self.stored_netname)
                        self.stored_netname = strzone(uid2name(self.crypto_idfp));
                if(self.stored_netname != self.netname)
                {
index 34446fdfcfddf0e3a6b78fa5d68967239b2737a9..abdae75d5e73f62c6feed4bbf25ba8580e948a05 100644 (file)
@@ -483,7 +483,7 @@ string ValidateMap(string validated_map, entity caller)
 {
        validated_map = MapInfo_FixName(validated_map);
        
-       if(!validated_map)
+       if not(validated_map)
        {
                print_to(caller, "This map is not available on this server.");
                return string_null;
index 0a2fe02b66fcf13c88c02240c0fb5b653f31ed88..6a0dcdf8b4e01679d23dfd1576c581e2c061e3ce 100644 (file)
@@ -355,7 +355,7 @@ void dom_controlpoint_setup()
 
        self.cnt = -1;
 
-       if(!self.message)
+       if(self.message == "")
                self.message = " has captured a control point";
 
        if(self.DOMPOINTFRAGS <= 0)
index fe1cd207dd918dd249cbbc9d75894b9db18299cf..293c78f001f0f3a2df0c050d91102db2b53a4289 100644 (file)
@@ -66,7 +66,7 @@ void SUB_UseTargets()
                if(clienttype(activator) == CLIENTTYPE_REAL)
                {
                        centerprint (activator, self.message);
-                       if (!self.noise)
+                       if (self.noise == "")
                                play2(activator, "misc/talk.wav");
                }
        }
@@ -508,9 +508,9 @@ void spawnfunc_trigger_hurt()
        self.enemy = world; // I hate you all
        if (!self.dmg)
                self.dmg = 1000;
-       if (!self.message)
+       if (self.message == "")
                self.message = "was in the wrong place";
-       if (!self.message2)
+       if (self.message2 == "")
                self.message2 = "was thrown into a world of hurt by";
        // self.message = "someone like %s always gets wrongplaced";
 
@@ -1339,9 +1339,9 @@ void spawnfunc_misc_laser()
        if(self.colormod == '0 0 0')
                if(!self.alpha)
                        self.colormod = '1 0 0';
-       if(!self.message)
+       if(self.message == "")
                self.message = "saw the light";
-       if (!self.message2)
+       if (self.message2 == "")
                self.message2 = "was pushed into a laser by";
        if(!self.scale)
                self.scale = 1;
index 38a1e249d7847a954e20a9df455dd2dfa8289b67..08fd83fe3fab99c12c6a448e5f6198328281523c 100644 (file)
@@ -431,8 +431,12 @@ float Ban_IsClientBanned(entity client, float idx)
                if(ban_idfp == s) return TRUE;
        }
        if(ipbanned)
-               if(!autocvar_g_banned_list_idmode || !ban_idfp)
+       {
+               if(!autocvar_g_banned_list_idmode)
+                       return TRUE;
+               if not(ban_idfp)
                        return TRUE;
+       }
        return FALSE;
 }
 
index 626e535b4517f0614c0da9464846fa2682d03279..1b423f5020f5646312a3c0b8d7a14380bb073344 100644 (file)
@@ -186,7 +186,7 @@ void spawnfunc_item_key() {
                _netname = "FLUFFY PINK keycard";
                _colormod = '1 1 1';
 
-               if (!self.netname) {
+               if (self.netname == "") {
                        objerror("item_key doesn't have a default name for this key and a custom one was not specified!");
                        remove(self);
                        return;
@@ -203,14 +203,14 @@ void spawnfunc_item_key() {
                _model = "models/keys/key.md3";
        } else if (self.itemkeys >= ITEM_KEY_BIT(3) && self.itemkeys <= ITEM_KEY_BIT(5)) {
                _model = "models/keys/key.md3"; // FIXME: replace it by a keycard model!
-       } else if (!self.model) {
+       } else if (self.model == "") {
                objerror("item_key doesn't have a default model for this key and a custom one was not specified!");
                remove(self);
                return;
        }
        
        // set defailt netname
-       if (!self.netname)
+       if (self.netname == "")
                self.netname = _netname;
        
        // set default colormod
@@ -218,14 +218,14 @@ void spawnfunc_item_key() {
                self.colormod = _colormod;
        
        // set default model
-       if (!self.model)
+       if (self.model == "")
                self.model = _model;
        
        // set default pickup message
-       if (!self.message)
+       if (self.message == "")
                self.message = strzone(strcat("You've picked up the ", self.netname, "!"));
 
-       if (!self.noise)
+       if (self.noise == "")
                self.noise = "misc/itempickup.wav";
        
        // save the name for later
@@ -391,11 +391,11 @@ void spawnfunc_trigger_keylock(void) {
        }
 
        // set unlocked message 
-       if (!self.message)
+       if (self.message == "")
                self.message = "Unlocked!";
        
        // set default unlock noise
-       if (!self.noise) {
+       if (self.noise == "") {
                if (self.sounds == 1)
                        self.noise = "misc/secret.wav";
                else if (self.sounds == 2)
@@ -405,11 +405,11 @@ void spawnfunc_trigger_keylock(void) {
        }
        
        // set default use key sound
-       if (!self.noise1)
+       if (self.noise1 == "")
                self.noise1 = "misc/decreasevalue.wav";
        
        // set closed sourd
-       if (!self.noise2)
+       if (self.noise2 == "")
                self.noise2 = "misc/talk.wav";
        
        // delay between triggering message2 and trigger2
index 33b53385be0e3adc547a2e808a18f5958e65001d..bd6b9962cc2d623b81a13db5e3733c3b562e5a17 100644 (file)
@@ -504,17 +504,17 @@ void Item_RespawnCountdown (void)
                                        rgb = '1 0 0';
                                }
                        }
-                       if(!name)
-                       {
-                               print("Unknown powerup-marked item is wanting to respawn\n");
-                               localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self)));
-                       }
                        if(name)
                        {
                                WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
                                if(self.waypointsprite_attached)
                                        WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
                        }
+                       else
+                       {
+                               print("Unknown powerup-marked item is wanting to respawn\n");
+                               localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self)));
+                       }
                }
                sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound
                if(self.waypointsprite_attached)
index df511c63795d611068e2b74d2fc85ba896f91383..0b9da88faf2b97fc524f472364bc2ae4f6dabc7f 100644 (file)
@@ -191,9 +191,9 @@ void spawnfunc_func_plat()
     if(self.spawnflags & 4)
         self.dmg = 10000;
 
-    if(self.dmg && (!self.message))
+    if(self.dmg && (self.message == ""))
                self.message = "was squished";
-    if(self.dmg && (!self.message2))
+    if(self.dmg && (self.message2 == ""))
                self.message2 = "was squished by";
 
        if (self.sounds == 1)
@@ -282,7 +282,7 @@ void train_next()
        targ = find(world, targetname, self.target);
        self.enemy = targ;
        self.target = targ.target;
-       if (!self.target)
+       if (self.target == "")
                objerror("train_next: no next target");
        self.wait = targ.wait;
        if (!self.wait)
@@ -302,7 +302,7 @@ void func_train_find()
        entity targ;
        targ = find(world, targetname, self.target);
        self.target = targ.target;
-       if (!self.target)
+       if (self.target == "")
                objerror("func_train_find: no next target");
        setorigin(self, targ.origin - self.mins);
        self.nextthink = self.ltime + 1;
@@ -319,7 +319,7 @@ void spawnfunc_func_train()
        if (self.noise != "")
                precache_sound(self.noise);
 
-       if (!self.target)
+       if (self.target == "")
                objerror("func_train without a target");
        if (!self.speed)
                self.speed = 100;
@@ -332,9 +332,9 @@ void spawnfunc_func_train()
        InitializeEntity(self, func_train_find, INITPRIO_SETLOCATION);
 
        self.blocked = generic_plat_blocked;
-       if(self.dmg & (!self.message))
+       if(self.dmg && (self.message == ""))
                self.message = " was squished";
-    if(self.dmg && (!self.message2))
+    if(self.dmg && (self.message2 == ""))
                self.message2 = "was squished by";
        if(self.dmg && (!self.dmgtime))
                self.dmgtime = 0.25;
@@ -395,9 +395,9 @@ void spawnfunc_func_rotating()
        
        self.pos1 = self.avelocity;
     
-    if(self.dmg & (!self.message))
+    if(self.dmg && (self.message == ""))
         self.message = " was squished";
-    if(self.dmg && (!self.message2))
+    if(self.dmg && (self.message2 == ""))
                self.message2 = "was squished by";
 
 
@@ -469,9 +469,9 @@ void spawnfunc_func_bobbing()
 
        // damage when blocked
        self.blocked = generic_plat_blocked;
-       if(self.dmg & (!self.message))
+       if(self.dmg && (self.message == ""))
                self.message = " was squished";
-    if(self.dmg && (!self.message2))
+    if(self.dmg && (self.message2 == ""))
                self.message2 = "was squished by";
        if(self.dmg && (!self.dmgtime))
                self.dmgtime = 0.25;
@@ -542,9 +542,9 @@ void spawnfunc_func_pendulum()
                self.speed = 30;
        // not initializing self.dmg to 2, to allow damageless pendulum
 
-       if(self.dmg & (!self.message))
+       if(self.dmg && (self.message == ""))
                self.message = " was squished";
-       if(self.dmg && (!self.message2))
+       if(self.dmg && (self.message2 == ""))
                self.message2 = "was squished by";
        if(self.dmg && (!self.dmgtime))
                self.dmgtime = 0.25;
@@ -1303,9 +1303,9 @@ void LinkDoors()
        {
                if(t.health && !self.health)
                        self.health = t.health;
-               if(t.targetname && !self.targetname)
+               if((t.targetname != "") && (self.targetname == ""))
                        self.targetname = t.targetname;
-               if(t.message != "" && self.message == "")
+               if((t.message != "") && (self.message == ""))
                        self.message = t.message;
                if (t.absmin_x < cmins_x)
                        cmins_x = t.absmin_x;
@@ -1420,9 +1420,9 @@ void spawnfunc_func_door()
        // if(self.spawnflags & 8)
        //      self.dmg = 10000;
 
-    if(self.dmg && (!self.message))
+    if(self.dmg && (self.message == ""))
                self.message = "was squished";
-    if(self.dmg && (!self.message2))
+    if(self.dmg && (self.message2 == ""))
                self.message2 = "was squished by";
 
        if (self.sounds > 0)
@@ -1546,9 +1546,9 @@ void spawnfunc_func_door_rotating()
     if(self.spawnflags & 8)
         self.dmg = 10000;
 
-    if(self.dmg && (!self.message))
+    if(self.dmg && (self.message == ""))
                self.message = "was squished";
-    if(self.dmg && (!self.message2))
+    if(self.dmg && (self.message2 == ""))
                self.message2 = "was squished by";
 
     if (self.sounds > 0)
@@ -1893,9 +1893,9 @@ void spawnfunc_func_fourier()
        self.cnt = 360 / self.speed;
 
        self.blocked = generic_plat_blocked;
-       if(self.dmg & (!self.message))
+       if(self.dmg && (self.message == ""))
                self.message = " was squished";
-    if(self.dmg && (!self.message2))
+    if(self.dmg && (self.message2 == ""))
                self.message2 = "was squished by";
        if(self.dmg && (!self.dmgtime))
                self.dmgtime = 0.25;
@@ -2056,9 +2056,9 @@ void spawnfunc_func_vectormamamam()
                self.target4normal = normalize(self.target4normal);
 
        self.blocked = generic_plat_blocked;
-       if(self.dmg & (!self.message))
+       if(self.dmg && (self.message == ""))
                self.message = " was squished";
-    if(self.dmg && (!self.message2))
+    if(self.dmg && (self.message == ""))
                self.message2 = "was squished by";
        if(self.dmg && (!self.dmgtime))
                self.dmgtime = 0.25;