Merge in xonotic/xonotic-data.pk3dir.git: terencehill/superspec_fixes
git-manager created issue #1701 (closed) on 2013-06-22T22:28:16Z:
Purpose of the branch:
Fixed a lot of typos
Fix superspec bug (#1686) that caused to see in the HUD you name instead of the auto-spectated player name
I've also added this small and simple feature:
Make cmd followfc change to the other fc if we are already spectating a fc
Repository: xonotic/xonotic-data.pk3dir.git Commit: 4d42bd03 Branch: terencehill/superspec_fixes
Merge commands:
cd data/xonotic-data.pk3dir
git checkout master
git reset --hard origin/master
git pull && git diff '4d42bd03a1c0c82d64619668a447a0009f9713c7'..'origin/terencehill/superspec_fixes'
# please check that the diff you just saw did not contain anything complex that
# needs a new merge request, and review these changes
git merge --no-ff 'origin/terencehill/superspec_fixes'
# please make sure this merge worked, and if not, fix merge conflicts and git
# commit BEFORE the next command
#
# also, THIS is the point to do final pre-merge testing
#
# use git reset --hard origin/master to bail out
git push && git push --delete origin 'terencehill/superspec_fixes'
Diffstat:
qcsrc/server/mutators/mutator_superspec.qc | 67 +++++++++-------------------
1 files changed, 21 insertions(+), 46 deletions(-)
Revision log:
commit 4d42bd03a1c0c82d64619668a447a0009f9713c7
Author: terencehill
Commit: terencehill
Make cmd followfc change to the other fc if we are already spectating a fc
commit c16b8ed5b3a2ed7943f6b8ae2a54d9fcb391c2d9
Author: terencehill
Commit: terencehill
Fix superspec bug that caused to see in the HUD you name instead of the auto-spectated player name. This bug must be appeared when #define COMPAT_XON050_ENGINE was removed as for some reason COMPAT_XON050_ENGINE mode inhibits it
commit ffd5bef06fd799972334e0248ef4301f01b82a78
Author: terencehill
Commit: terencehill
Also remove pointless commented out code
commit c592dcb685a8462677ed333ddd64f519f584d613
Author: terencehill
Commit: terencehill
Fix color codes too...
commit 9673552f69c9d5eb1003c02baa2114693fb2cd6e
Author: terencehill
Commit: terencehill
OMG! There were SOME typos in the superspec code...
User agreed to the GPLv2*.
Diff:
<pre>diff —git a/qcsrc/server/mutators/mutator\_superspec.qc b/qcsrc/server/mutators/mutator\_superspec.qc
index eea3979..96c9f25 100644
— a/qcsrc/server/mutators/mutator\_superspec.qc
**+ b/qcsrc/server/mutators/mutator\_superspec.qc
@ -22,10 +22,7
@
float *spectate
{
if 1)
-
{
-
PutObserverInServer(); self.classname = "spectator";
-
}
return TRUE; } @@ -35,7 +32,6 @@ void superspec_save_client_conf() string fn = "superspec-local.options"; float fh;
-
if not(_ISLOCAL) { if(self.crypto_idfp “”)
@ -65,7 +61,6
@ void superspec_save_client_conf void superspec_msg {
@ -121,7 +116,6
@ MUTATOR_HOOKFUNCTION
}
}
sprint);
if
if ||
||
||
@ -134,7 +128,7
@ MUTATOR_HOOKFUNCTION
if)
{
if
- superspec_msg, 2);
- superspec_msg, 2);
}
else
{
@ -207,7 +201,6
@ MUTATOR_HOOKFUNCTION self.superspec_itemfilter = strzone); }
return TRUE;
}
@ -221,9 +214,9
@ MUTATOR_HOOKFUNCTION
if "help")
{
_aspeco = "use cmd superspec [option] [on|off] to set options\n\n";
-
\_aspeco = strcat(\_aspeco, "\^3 silent \^7(short\^5 si\^7) supress ALL mesagess from superspectate.\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 verrbose \^7(short\^5 ve\^7) makes superspectate print some additional information.\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 item\_message \^7(short\^5 im\^7) makes superspectate print items that was picked up.\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 silent \^7(short\^5 si\^7) supresses ALL messages from superspectate.\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 verbose \^7(short\^5 ve\^7) makes superspectate print some additional information.\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 item\_message \^7(short\^5 im\^7) makes superspectate print items that were picked up.\\n"); \_aspeco = strcat(\_aspeco, "\^7 Use cmd superspec\_itemfilter \\"item\_class1 item\_class2\\" to set up a filter of what to show with \^3item\_message.\\n"); superspec\_msg("\^2Available Super Spectate \^3options:\\n\\n\\n", "\\n\^2Available Super Spectate \^3options:\\n", self, \_aspeco, 1); return TRUE;
@@ -258,15 +251,14 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand) } }
-
\_aspeco = ""; OPTIONINFO(self.superspec\_flags, \_aspeco, SSF\_SILENT, "Silent", "silent", "si"); OPTIONINFO(self.superspec\_flags, \_aspeco, SSF\_VERBOSE, "Verbose", "verbose", "ve"); OPTIONINFO(self.superspec\_flags, \_aspeco, SSF\_ITEMMSG, "Item pickup messages", "item\_message", "im"); superspec\_msg("\^3Current Super Spectate options are:\\n\\n\\n\\n\\n", "\\n\^3Current Super Spectate options are:\\n", self, \_aspeco, 1);
-
return TRUE;
-
return TRUE;
///////////////////// @@ -284,10 +276,10 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand) _aspeco = strcat(_aspeco, "^3 mega_health ^7(short^5 mh^7) for automatic spectate on mega health\n"); _aspeco = strcat(_aspeco, "^3 mega_armor ^7(short^5 ma^7) for automatic spectate on mega armor\n"); _aspeco = strcat(_aspeco, "^3 flag_grab ^7(short^5 fg^7) for automatic spectate on CTF flag grab\n");
-
\_aspeco = strcat(\_aspeco, "\^3 observer\_only (short\^5 oo\^7) for automatic spectate only if in observer mode\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 show\_what (short\^5 sw\^7) to display what event triggerd autospectate\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 item\_msg \^7(short\^5 im\^7) to autospec when item\_message in superspectate is triggerd\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 all \^7(short \^5aa\^7) turn everything on/off\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 observer\_only \^7(short\^5 oo\^7) for automatic spectate only if in observer mode\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 show\_what \^7(short\^5 sw\^7) to display what event triggered autospectate\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 item\_msg \^7(short\^5 im\^7) to autospec when item\_message in superspectate is triggered\\n");
-
\_aspeco = strcat(\_aspeco, "\^3 all \^7(short \^5aa\^7) to turn everything on/off\\n"); superspec\_msg("\^2Available Auto Spectate \^3options:\\n\\n\\n", "\\n\^2Available Auto Spectate \^3options:\\n", self, \_aspeco, 1); return TRUE; }
@@ -334,7 +326,7 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand) OPTIONINFO(self.autospec_flags, _aspeco, ASF_MEGA_HP, "Mega Health", "mega_health", "mh"); OPTIONINFO(self.autospec_flags, _aspeco, ASF_MEGA_AR, "Mega Armor", "mega_armor", "ma"); OPTIONINFO(self.autospec_flags, _aspeco, ASF_FLAG_GRAB, "Flag grab", "flag_grab","fg");
-
OPTIONINFO(self.autospec\_flags, \_aspeco, ASF\_OBSERVER\_ONLY, "Only switch if Observer", "observer\_only", "oo");
-
OPTIONINFO(self.autospec\_flags, \_aspeco, ASF\_OBSERVER\_ONLY, "Only switch if observer", "observer\_only", "oo"); OPTIONINFO(self.autospec\_flags, \_aspeco, ASF\_SHOWWHAT, "Show what item triggered spectate", "show\_what", "sw"); OPTIONINFO(self.autospec\_flags, \_aspeco, ASF\_SSIM, "Switch on superspec item message", "item\_msg", "im");
@@ -351,7 +343,7 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand) return _spectate(_player); }
-
superspec\_msg("", "", self, "No active powerups\\n", 1);
-
superspec\_msg("", "", self, "No active powerup\\n", 1); return TRUE;
@@ -368,7 +360,7 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand) return TRUE; }
- if(cmd_name “followstshield”)
- if
{
entity*player;
FOR_EACH_PLAYER
@ -388,6 +380,7
@ MUTATOR_HOOKFUNCTION entity player; floatteam = 0;
- float found = FALSE;
if(cmd_argc 2) { @@ -400,9 +393,15 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand) FOR_EACH_PLAYER(_player) { if(_player.flagcarried && (_player.team team ||team 0))
-
{
-
found = TRUE;
-
if(\_team 0 && IS\_SPEC(self) && self.enemy \_player)
-
continue; // already spectating a fc, try to find the other fc return \_spectate(\_player); }
-
}
-
if(!found) superspec\_msg("", "", self, "No active flag carrier\\n", 1); return TRUE;
} @@ -423,20 +422,12 @@ MUTATOR_HOOKFUNCTION(superspec_BuildMutatorsPrettyString) return 0; }
-/* -MUTATOR_HOOKFUNCTION(superspec_PlayerSpawn) -{
- return FALSE; -} -*/
void superspec_hello() { if(self.enemy.crypto_idfp “”) centerprint(self.enemy, “Your client have/allow no crypto id, superspec options will not be saved/restored.”); else
- centerprint(self.enemy, sprintf(“Hello s\nSince your client has a Crypto ID, your superspec preferenses will be presisted on this server.", self.enemy.netname));
-
centerprint(self.enemy, sprintf("Hello s\\nSince your client has a Crypto ID, your superspec preferences will be persisted on this server.”, self.enemy.netname));
remove(self);
}
@ -475,7 +466,7
@ MUTATOR_HOOKFUNCTION(superspec_ClientConnect)
string _magic = fgets(fh);
if(magic !=SSMAGIX)
{
- dprint(“^1ERROR^7 While reading superspec options file: unkown magic\n”);
- dprint(“^1ERROR^7 While reading superspec options file: unknown magic\n”);
}
else
{
@ -495,19 +486,6
@ MUTATOR_HOOKFUNCTION(superspec_ClientDisconnect) return FALSE; }
~~/* ~~MUTATOR_HOOKFUNCTION(superspec_MakePlayerObserver) ~~{ ~~ return FALSE; ~~} ~~ ~~MUTATOR_HOOKFUNCTION ~~{
- return FALSE; ~~} ~~*/
MUTATOR_DEFINITION(mutator_superspec) {
@ -516,9 +494,6
@ MUTATOR_DEFINITION(mutator_superspec)
MUTATOR_HOOK(SV_ParseClientCommand, superspec_SV_ParseClientCommand, CBC_ORDER_ANY);
MUTATOR_HOOK(ItemTouch, superspec_ItemTouch, CBC_ORDER_ANY);
MUTATOR_HOOK(ClientConnect, superspec_ClientConnect, CBC_ORDER_ANY);
- //MUTATOR_HOOK(PlayerSpawn, superspec_PlayerSpawn, CBC_ORDER_ANY);
- //MUTATOR_HOOK(PlayerPreThink, superspec_PlayerPreThink, CBC_ORDER_ANY);
- //MUTATOR_HOOK(MakePlayerObserver, superspec_MakePlayerObserver, CBC_ORDER_ANY); MUTATOR_HOOK(ClientDisconnect, superspec_ClientDisconnect, CBC_ORDER_ANY);
return 0;