Zandronum Chat @ irc.zandronum.com
#zandronum
Get the latest version: 3.0
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002105Zandronum[All Projects] Suggestionpublic2015-02-15 21:552018-09-30 21:37
ReporterCatastrophe 
Assigned ToTorr Samaho 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformMicrosoftOSWindowsOS VersionXP/Vista/7
Product Version1.3 
Target Version2.1Fixed in Version2.1 
Summary0002105: Added new ccmd ifspectator
Description+ - Added new ccmd ifspectator that only runs if you're a spectator [Cata]
Additional InformationExample binds.

-=A=-
bind mouse1 " ifspectator noclip; +attack"

This will do +attack and noclip if you are spectating. When you're in-game it will only do +attack.

-=B=-
bind mwheelup "weapnext; ifspectator spynext"
bind mwheeldown "weapprev; ifspectator spyprev"

This will let you use your mouse wheel to scroll through players as a spectator. When you are in-game it will then scroll through weapons like it normally does.

-=C=-
bind i "ifspectator \"wait 35; say hi; wait 35; say bye\" "

This will -only- run as a spectator. Nothing will happen in-game by pressing i.
Attached Filesdiff file icon specbind.diff [^] (688 bytes) 2015-02-15 21:55 [Show Content]
diff file icon specbindv2.diff [^] (649 bytes) 2015-02-16 20:22 [Show Content]

- Relationships

-  Notes
User avatar (0011700)
Edward-san (developer)
2015-02-16 12:58
edited on: 2015-02-16 13:23

You could use directly "AddCommandString(cmdTotal.GetChars());" instead of creating the char buffer "cmd".

[edit]Argh! AddCommandString accepts 'char *' and changes the buffer, too! Well, you can still simplify that with:


char *cmd = strdup(cmdTotal.GetChars());
AddCommandString(cmd);
free(cmd);


[edit2]Actually, you can use this:

AddCommandString(cmdTotal.LockBuffer());
cmdTotal.UnlockBuffer();


User avatar (0011707)
Catastrophe (reporter)
2015-02-16 20:23
edited on: 2015-02-16 20:23

@Edward

Uploaded an updated diff with your suggestion.

User avatar (0012695)
Torr Samaho (administrator)
2015-06-14 07:59

I added a slightly refined version of your patch.
User avatar (0012697)
cobalt (updater)
2015-06-14 08:09

Issue addressed by commit 427da93e2ff1: Added a slightly refined version of Catastrophe's patch that adds the CCMD 'ifspectator' (addresses 2105).
Committed by Benjamin Berkels [Torr Samaho] on Sunday 14 June 2015 09:58:42

Changes in files:

 docs/zandronum-history.txt | 1 +
 src/c_cmds.cpp | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)


Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: Hypnotoad
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2015-02-15 21:55 Catastrophe New Issue
2015-02-15 21:55 Catastrophe File Added: specbind.diff
2015-02-16 12:58 Edward-san Note Added: 0011700
2015-02-16 13:14 Edward-san Note Edited: 0011700 View Revisions
2015-02-16 13:22 Edward-san Note Edited: 0011700 View Revisions
2015-02-16 13:23 Edward-san Note Edited: 0011700 View Revisions
2015-02-16 20:22 Catastrophe File Added: specbindv2.diff
2015-02-16 20:23 Catastrophe Note Added: 0011707
2015-02-16 20:23 Catastrophe Note Edited: 0011707 View Revisions
2015-02-22 12:26 Dusk Status new => needs review
2015-06-14 07:59 Torr Samaho Note Added: 0012695
2015-06-14 08:09 cobalt Assigned To => Torr Samaho
2015-06-14 08:09 cobalt Status needs review => needs testing
2015-06-14 08:09 cobalt Target Version => 2.1
2015-06-14 08:09 cobalt Additional Information Updated View Revisions
2015-06-14 08:09 cobalt Note Added: 0012697
2015-06-24 22:45 Dusk Status needs testing => resolved
2015-06-24 22:45 Dusk Fixed in Version => 2.2
2015-06-24 22:45 Dusk Resolution open => fixed
2015-06-24 22:47 Dusk Fixed in Version 2.2 => 2.1
2018-09-30 21:37 Blzut3 Status resolved => closed






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker