]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/spawning.qc
Replace all direct assignments to self with setself(e)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / spawning.qc
index 8e7810bbb117de338ed62dc6a32e6684466e8f1e..57302ee7fe051db32f18e36dbcd0cd4e52963421 100644 (file)
@@ -35,7 +35,7 @@ string W_Apply_Weaponreplace(string in)
 }
 
 void weapon_defaultspawnfunc(float wpn)
-{
+{SELFPARAM();
        entity e;
        float t;
        string s;
@@ -76,7 +76,7 @@ void weapon_defaultspawnfunc(float wpn)
                                        e = get_weaponinfo(j);
                                        if(e.netname == s)
                                        {
-                                               self = spawn();
+                                               setself(spawn());
                                                copyentity(oldself, self);
                                                self.classname = "replacedweapon";
                                                weapon_defaultspawnfunc(j);
@@ -85,10 +85,10 @@ void weapon_defaultspawnfunc(float wpn)
                                }
                                if(j > WEP_LAST)
                                {
-                                       print("The weapon replace list for ", oldself.classname, " contains an unknown weapon ", s, ". Skipped.\n");
+                                       LOG_INFO("The weapon replace list for ", oldself.classname, " contains an unknown weapon ", s, ". Skipped.\n");
                                }
                        }
-                       self = oldself;
+                       setself(oldself);
                }
                if(t >= 1) // always the case!
                {
@@ -105,7 +105,7 @@ void weapon_defaultspawnfunc(float wpn)
                        }
                        if(j > WEP_LAST)
                        {
-                               print("The weapon replace list for ", self.classname, " contains an unknown weapon ", s, ". Skipped.\n");
+                               LOG_INFO("The weapon replace list for ", self.classname, " contains an unknown weapon ", s, ". Skipped.\n");
                        }
                }
                if(wpn == 0)