Merge remote-tracking branch 'origin/mirceakitsune/sandbox'
authorRudolf Polzer <divverent@xonotic.org>
Sun, 4 Dec 2011 15:43:10 +0000 (16:43 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 4 Dec 2011 15:43:10 +0000 (16:43 +0100)
Conflicts:
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src

1  2 
defaultXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
qcsrc/server/sv_main.qc

Simple merge
Simple merge
Simple merge
@@@ -1086,9 -1101,9 +1101,13 @@@ void readlevelcvars(void
                MUTATOR_ADD(mutator_rocketflying);
        if(cvar("g_vampire"))
                MUTATOR_ADD(mutator_vampire);
 +      if(cvar("g_spawn_near_teammate"))
 +              MUTATOR_ADD(mutator_spawn_near_teammate);
 +
++      // is this a mutator? is this a mode?
+       if(cvar("g_sandbox"))
+               MUTATOR_ADD(sandbox);
        if(cvar("sv_allow_fullbright"))
                serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
  
@@@ -190,11 -189,5 +190,14 @@@ MUTATOR_HOOKABLE(SV_ParseClientCommand)
                }
        */
  
 +MUTATOR_HOOKABLE(Spawn_Score);
 +      // called when a spawnpoint is being evaluated
 +      // return 1 to make the spawnpoint unusable
 +      // INPUT
 +      entity self; // player wanting to spawn
 +      entity spawn_spot; // spot to be evaluated
 +      // IN+OUT
 +      vector spawn_score; // _x is priority, _y is "distance"
++
+ MUTATOR_HOOKABLE(SV_StartFrame);
+       // runs globally each server frame
@@@ -7,5 -7,5 +7,6 @@@ MUTATOR_DECLARATION(mutator_nix)
  MUTATOR_DECLARATION(mutator_dodging);
  MUTATOR_DECLARATION(mutator_rocketflying);
  MUTATOR_DECLARATION(mutator_vampire);
 +MUTATOR_DECLARATION(mutator_spawn_near_teammate);
+ MUTATOR_DECLARATION(sandbox);
@@@ -195,7 -195,7 +195,8 @@@ mutators/mutator_nix.q
  mutators/mutator_dodging.qc
  mutators/mutator_rocketflying.qc
  mutators/mutator_vampire.qc
 +mutators/mutator_spawn_near_teammate.qc
+ mutators/sandbox.qc
  
  ../warpzonelib/anglestransform.qc
  ../warpzonelib/mathlib.qc
@@@ -231,8 -231,19 +231,10 @@@ void StartFrame (void
        RuneMatchGivePoints();
        bot_serverframe();
  
 -      if(autocvar_spawn_debugview)
 -      {
 -              RandomSelection_Init();
 -              for(self = world; (self = find(self, classname, "player")); )
 -                      RandomSelection_Add(self, 0, string_null, 1, 0);
 -              self = RandomSelection_chosen_ent;
 -              SelectSpawnPoint(0);
 -      }
 -
        FOR_EACH_PLAYER(self)
                self.porto_forbidden = max(0, self.porto_forbidden - 1);
+       MUTATOR_CALLHOOK(SV_StartFrame);
  }
  
  .vector originjitter;