]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clean out some more self uses
authorMario <mario@smbclan.net>
Thu, 19 May 2016 20:35:38 +0000 (06:35 +1000)
committerMario <mario@smbclan.net>
Thu, 19 May 2016 20:35:38 +0000 (06:35 +1000)
qcsrc/server/cl_client.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_quake3.qc
qcsrc/server/teamplay.qc
qcsrc/server/teamplay.qh

index f6918c606490422fb35afd4d6979e9b686b0c2fc..d446322b38c7e67bbc5d951816c271f4982dd056 100644 (file)
@@ -1141,7 +1141,7 @@ void ClientConnect()
                if (!autocvar_g_campaign)
                {
                        this.motd_actived_time = -1;
-                       Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
+                       Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage(this));
                }
 
                if (g_weaponarena_weapons == WEPSET(TUBA))
@@ -1883,7 +1883,7 @@ void PrintWelcomeMessage(entity this)
                } else {
                        if (PHYS_INPUT_BUTTON_INFO(this)) {
                                this.motd_actived_time = time;
-                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
+                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage(this));
                        }
                }
        }
index e7d6dbfb5b2b9f34cc5eb967930ce4d3d34e5ca7..44bd23c8c292712db9dc9cb3fff5f4a316ad1c0d 100644 (file)
@@ -236,7 +236,7 @@ void StartFrame()
 .float anglejitter;
 .string gametypefilter;
 .string cvarfilter;
-float DoesQ3ARemoveThisEntity();
+bool DoesQ3ARemoveThisEntity(entity this);
 void SV_OnEntityPreSpawnFunction()
 {SELFPARAM();
        __spawnfunc_expect = this;
@@ -357,7 +357,7 @@ LABEL(cvar_fail)
                }
        }
 
-       if(DoesQ3ARemoveThisEntity())
+       if(DoesQ3ARemoveThisEntity(self))
        {
                remove(self);
                return;
index ef614c7ac3eaf55885ae4bb8d99246e8ac9d09f3..c1bf96cd8805566f9360ead5dc91eba64835546d 100644 (file)
@@ -88,58 +88,58 @@ void target_init_verify(entity this)
 
 spawnfunc(target_init)
 {
-       self.spawnflags = 0; // remove all weapons except the ones listed below
-       self.netname = "shotgun"; // keep these weapons through the remove trigger
+       this.spawnflags = 0; // remove all weapons except the ones listed below
+       this.netname = "shotgun"; // keep these weapons through the remove trigger
        spawnfunc_target_items(this);
-       InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
+       InitializeEntity(this, target_init_verify, INITPRIO_FINDTARGET);
 }
 
 // weapon give ent from defrag
 void target_give_init(entity this)
 {
        entity targ;
-       for (targ = world; (targ = find(targ, targetname, self.target)); ) {
+       for (targ = world; (targ = find(targ, targetname, this.target)); ) {
                if (targ.classname == "weapon_rocketlauncher" || targ.classname == "weapon_devastator") {
-                       self.ammo_rockets += targ.count * WEP_CVAR(devastator, ammo);
-                       self.netname = "devastator";
+                       this.ammo_rockets += targ.count * WEP_CVAR(devastator, ammo);
+                       this.netname = "devastator";
                }
                else if (targ.classname == "weapon_plasmagun") {
-                       self.ammo_rockets += targ.count * WEP_CVAR_PRI(hagar, ammo); // WEAPONTODO
-                       if(self.netname == "")
-                               self.netname = "hagar";
+                       this.ammo_rockets += targ.count * WEP_CVAR_PRI(hagar, ammo); // WEAPONTODO
+                       if(this.netname == "")
+                               this.netname = "hagar";
                        else
-                               self.netname = strcat(self.netname, " hagar");
+                               this.netname = strcat(this.netname, " hagar");
                }
                else if (targ.classname == "weapon_bfg") {
-                       self.ammo_cells += targ.count * WEP_CVAR_PRI(crylink, ammo);
-                       if(self.netname == "")
-                               self.netname = "crylink";
+                       this.ammo_cells += targ.count * WEP_CVAR_PRI(crylink, ammo);
+                       if(this.netname == "")
+                               this.netname = "crylink";
                        else
-                               self.netname = strcat(self.netname, " crylink");
+                               this.netname = strcat(this.netname, " crylink");
                }
                else if (targ.classname == "weapon_grenadelauncher" || targ.classname == "weapon_mortar") {
-                       self.ammo_rockets += targ.count * WEP_CVAR_PRI(mortar, ammo); // WEAPONTODO
-                       if(self.netname == "")
-                               self.netname = "mortar";
+                       this.ammo_rockets += targ.count * WEP_CVAR_PRI(mortar, ammo); // WEAPONTODO
+                       if(this.netname == "")
+                               this.netname = "mortar";
                        else
-                               self.netname = strcat(self.netname, " mortar");
+                               this.netname = strcat(this.netname, " mortar");
                }
                else if (targ.classname == "item_armor_body")
-                       self.armorvalue = 100;
+                       this.armorvalue = 100;
                else if (targ.classname == "item_health_mega")
-                       self.health = 200;
+                       this.health = 200;
                //remove(targ); // removing ents in init functions causes havoc, workaround:
         targ.think = SUB_Remove_self;
         targ.nextthink = time;
        }
-       self.spawnflags = 2;
+       this.spawnflags = 2;
        spawnfunc_target_items(this);
-       InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
+       InitializeEntity(this, target_init_verify, INITPRIO_FINDTARGET);
 }
 
 spawnfunc(target_give)
 {
-       InitializeEntity(self, target_give_init, INITPRIO_FINDTARGET);
+       InitializeEntity(this, target_give_init, INITPRIO_FINDTARGET);
 }
 
 //spawnfunc(item_flight)       /* handled by jetpack */
@@ -164,31 +164,31 @@ spawnfunc(item_flight)
 .float notq3a;
 .float notta;
 .string gametype;
-float DoesQ3ARemoveThisEntity()
-{SELFPARAM();
+bool DoesQ3ARemoveThisEntity(entity this)
+{
        // Q3 style filters (DO NOT USE, THIS IS COMPAT ONLY)
 
-       if(self.notq3a)
+       if(this.notq3a)
                if(!teamplay || g_tdm || g_ctf)
-                       return 1;
+                       return true;
 
-       if(self.notta)
+       if(this.notta)
                if (!(!teamplay || g_tdm || g_ctf))
-                       return 1;
+                       return true;
 
-       if(self.notsingle)
+       if(this.notsingle)
                if(maxclients == 1)
-                       return 1;
+                       return true;
 
-       if(self.notteam)
+       if(this.notteam)
                if(teamplay)
-                       return 1;
+                       return true;
 
-       if(self.notfree)
+       if(this.notfree)
                if(!teamplay)
-                       return 1;
+                       return true;
 
-       if(self.gametype)
+       if(this.gametype)
        {
                string gametypename;
                // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"}
@@ -200,9 +200,9 @@ float DoesQ3ARemoveThisEntity()
                if(maxclients == 1)
                        gametypename = "single";
                // we do not have the other types (oneflag, obelisk, harvester, teamtournament)
-               if(strstrofs(self.gametype, gametypename, 0) < 0)
-                       return 1;
+               if(strstrofs(this.gametype, gametypename, 0) < 0)
+                       return true;
        }
 
-       return 0;
+       return false;
 }
index c275faa7c300b3d97c1115f47603f06317108388..c85ed79ea39f6eaa8c156bf9f55064eb94d5cd0e 100644 (file)
@@ -80,11 +80,11 @@ void InitGameplayMode()
        InitializeEntity(world, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK);
 }
 
-string GetClientVersionMessage()
-{SELFPARAM();
+string GetClientVersionMessage(entity this)
+{
        string versionmsg;
-       if (self.version_mismatch) {
-               if(self.version < autocvar_gameversion) {
+       if (this.version_mismatch) {
+               if(this.version < autocvar_gameversion) {
                        versionmsg = "^3Your client version is outdated.\n\n\n### YOU WON'T BE ABLE TO PLAY ON THIS SERVER ###\n\n\nPlease update!!!^8";
                } else {
                        versionmsg = "^3This server is using an outdated Xonotic version.\n\n\n ### THIS SERVER IS INCOMPATIBLE AND THUS YOU CANNOT JOIN ###.^8";
@@ -95,7 +95,7 @@ string GetClientVersionMessage()
        return versionmsg;
 }
 
-string getwelcomemessage()
+string getwelcomemessage(entity this)
 {
        string s, modifications, motd;
 
@@ -123,8 +123,7 @@ string getwelcomemessage()
                modifications = strcat(modifications, ", Powerups");
        modifications = substring(modifications, 2, strlen(modifications) - 2);
 
-       string versionmessage;
-       versionmessage = GetClientVersionMessage();
+       string versionmessage = GetClientVersionMessage(this);
 
        s = strcat("This is Xonotic ", autocvar_g_xonoticversion, "\n", versionmessage);
        s = strcat(s, "^8\n\nmatch type is ^1", gamemode_name, "^8\n");
index df82a9cae6040e830e077a22bee2f13db963db9d..a9ded2c5aa140a432353a2f07c142b2a91fe5f39 100644 (file)
@@ -22,9 +22,9 @@ void ActivateTeamplay();
 
 void InitGameplayMode();
 
-string GetClientVersionMessage();
+string GetClientVersionMessage(entity this);
 
-string getwelcomemessage();
+string getwelcomemessage(entity this);
 
 void SetPlayerColors(entity pl, float _color);