]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_nexball.qc
Add collect delay for returning flags too
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_nexball.qc
index e732efc6f9db240ed2b5df044ddd1b094618f648..c27c466a6a69057cc607eb9dc413deb36eb2aa04 100644 (file)
@@ -117,7 +117,7 @@ void GiveBall(entity plyr, entity ball)
        ball.owner = ball.pusher = plyr; //"owner" is set to the player carrying, "pusher" to the last player who touched it
        ball.team = plyr.team;
        plyr.ballcarried = ball;
-       ball.dropperid = plyr.playerid;
+       ball.ctf_dropper = plyr;
 
        plyr.effects |= autocvar_g_nexball_basketball_effects_default;
        ball.effects &~= autocvar_g_nexball_basketball_effects_default;
@@ -141,7 +141,7 @@ void GiveBall(entity plyr, entity ball)
     self = plyr;    
     self.weaponentity.weapons = self.weapons;
     self.weaponentity.switchweapon = self.weapon;
-    self.weapons = W_WeaponBit(WEP_PORTO);            
+    self.weapons = W_WeaponBit(WEP_PORTO);      
     weapon_action(WEP_PORTO, WR_RESETPLAYER);
     self.switchweapon = WEP_PORTO;
     W_SwitchWeapon(WEP_PORTO);
@@ -287,7 +287,7 @@ void basketball_touch(void)
                football_touch();
                return;
        }
-       if(!self.cnt && other.classname == "player" && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_nexball_delay_collect))
+       if(!self.cnt && other.classname == "player" && (other != self.ctf_dropper || time > self.ctf_droptime + autocvar_g_nexball_delay_collect))
        {
                if(other.health <= 0)
                        return;
@@ -936,18 +936,15 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
     return FALSE;
 }
 
-
 MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
 {    
     self.weaponentity.weapons = 0;
     
     if(nexball_mode & NBM_BASKETBALL)
-        return FALSE;
-    
-    if(autocvar_g_weapon_stay)
-        return FALSE;
+        self.weapons |= W_WeaponBit(WEP_PORTO);
+    else
+        self.weapons = 0; //    W_WeaponBit(WEP_PORTO);
 
-    self.weapons = 0;
     return FALSE;
 }