From: Rudolf Polzer Date: Sun, 4 Dec 2011 15:43:10 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/mirceakitsune/sandbox' X-Git-Tag: xonotic-v0.6.0~35^2~18 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=93a42210757d659fd5b436a66c0c6cdc5eaf0a39;p=xonotic%2Fxonotic-data.pk3dir.git Merge remote-tracking branch 'origin/mirceakitsune/sandbox' Conflicts: qcsrc/server/miscfunctions.qc qcsrc/server/mutators/base.qh qcsrc/server/mutators/mutators.qh qcsrc/server/progs.src --- 93a42210757d659fd5b436a66c0c6cdc5eaf0a39 diff --cc qcsrc/server/miscfunctions.qc index f9a9990a4,87fa4d627..60644e6f2 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@@ -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; diff --cc qcsrc/server/mutators/base.qh index e668c1da1,621e4db6c..ecec3c87c --- a/qcsrc/server/mutators/base.qh +++ b/qcsrc/server/mutators/base.qh @@@ -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 diff --cc qcsrc/server/mutators/mutators.qh index ba7edaeec,349d945df..b53153f7b --- a/qcsrc/server/mutators/mutators.qh +++ b/qcsrc/server/mutators/mutators.qh @@@ -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); diff --cc qcsrc/server/progs.src index 30a6d2783,c69c54f46..6dd08bb1b --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@@ -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 diff --cc qcsrc/server/sv_main.qc index c4cc090c3,e0722e7ed..7ec4b49d6 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.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;