Commit Graph

73 Commits

Author SHA1 Message Date
Eric Wasylishen 5660094d1d host_cmd.c: add new "setpos" command.
developer cheat to teleport to a given origin, optionally looking in a given direction.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1308 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-06-07 07:08:23 +00:00
Eric Wasylishen 84bd3944b2 Modlist_Init: (win32) don't list "." as a mod.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1224 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-03 03:54:47 +00:00
Eric Wasylishen 0ba423061b Add filename tab-completion for "playdemo" and "record" commands
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1219 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-30 02:28:58 +00:00
Eric Wasylishen 7bcea9a968 Host_Pause_f: Allow pausing demos even if cls.demonum != -1, i.e. we are in a demo loop.
The logic to prevent pausing the demo loop was preventing pausing in some valid cases, and there's no special reason not to allow pausing a demo loop.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1218 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-29 18:33:19 +00:00
Eric Wasylishen f6755c56b8 ExtraMaps_Add: merge with Modlist_Add into new FileList_Add
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1217 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-29 18:33:14 +00:00
Eric Wasylishen a568c712c1 tab completion: lower size of filelist_item_t name buffer from MAX_OSPATH to 32 to avoid filling up the zone memory (this limits the length of maps / games you can tab-complete).
Prior to r1153 it was 32 for maps and MAX_OSPATH for mods.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1158 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-26 23:35:55 +00:00
Eric Wasylishen c31fb37b20 Refactor argument completion for "game" and "map" so all of the code is shared.
TODO: currently using a char[MAX_OSPATH] buffer to store map/mod names in the completion list which is probably unnecessairly large

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1153 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-24 08:26:14 +00:00
Eric Wasylishen 171b08cf39 Support pausing demo playback.
This is done by adding an extra 'demopaused' flag to client_static_t, separate from cl.paused because we don't want a svc_setpause inside the demo (caused by the player pausing during recording) to actually pause demo playback. The only potential failure case is, if the demo contains a svc_stufftext of the command "pause", the demo will pause itself when being played.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1147 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-12-08 19:30:36 +00:00
Eric Wasylishen e26923ec8a Host_Startdemos_f: set cls.demonum to -1 in the default case where we skip the demo loop.
Fixes a bug where if you launched QS and immediately did "playdemo [something]", after the demo finished, demo1.dem would start to play instead of returning to the console.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1146 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-12-08 19:30:30 +00:00
Eric Wasylishen 6afd1e5286 Host_Loadgame_f: don't break when there are } characters in quoted strings. Fixes issue loading savegames from retrojam1_skacky
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1145 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-12-08 19:30:21 +00:00
Ozkan Sezer b9032b7815 copyright years, general tidy-up, remove unused d_ifacea.h.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1059 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 08:55:46 +00:00
Ozkan Sezer 717b452da0 moved Host_Game_f to common.c, made it to use COM_AddGameDirectory(). moved in-memory pak structures, searchpatch structure and searchpath global declarations to common.h. adjusted affected extra patches.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1003 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 21:10:33 +00:00
Ozkan Sezer 1c4c5ba254 add the com_base_searchpaths thing of qw and use it in Host_Game_f(), kill the no longer needed com_nummissionpacks, KillGameDir() and NumGames().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@998 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 18:20:47 +00:00
Ozkan Sezer 9d2193f1d4 tighten Host_Game_f() a bit more
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@997 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 16:02:58 +00:00
Ozkan Sezer 985a16ee15 Host_Game_f(): simplify
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@996 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 14:29:12 +00:00
Eric Wasylishen a7bf2f59a4 Apply Baker's fix for cross-map demo playback (http://forums.inside3d.com/viewtopic.php?f=3&t=2397).
With that alone, the console would come down and slide up when the map changes in a demo.
I added a SCR_BeginLoadingPlaque() call in CL_ParseServerInfo, only done during demo playback, which shows the loading plaque and prevents the console from appearing and sliding up.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@976 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-25 02:55:25 +00:00
Ozkan Sezer fabac88a0f - ExtraMaps_Init: instead strstr(), directly compare the file extension bsp.
- Modlist_Init: cleanup: instead strstr(), compare the file extension pak.
 no need extra checking for "." and ".." in the inner while loop. break out
 of the inner while loop as soon as a pak file or progs.dat is found.

- ExtraMaps_Init, Modlist_Init, windows: instead of using dirent emulation,
 use windows' native FindFirstFile/FindNextFile/FindClose directly. adapted
 from fitzquake-0.85.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@946 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-01 11:21:54 +00:00
Ozkan Sezer 7b8b4bf14f git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@945 af15c1b1-3010-417e-b628-4374ebc0bcbd 2014-08-01 11:15:58 +00:00
Ozkan Sezer 005dbeffca remove unused var
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@943 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-07-30 09:45:07 +00:00
Ozkan Sezer b5e0d90e28 reset all models and set mod_numknown to 0 upon gamedir changes.
fixes issue described at:
http://celephais.net/board/view_thread.php?id=60452&start=825
also see http://forums.inside3d.com/viewtopic.php?f=12&t=5509


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@942 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-07-30 09:33:03 +00:00
Ozkan Sezer 14181eee15 Host_Game_f: fix broken behavion if -gamedir is specified. (use com_basedir, not host_parms->basedir)
Modlist_Init: no need for -basedir check, just use com_basedir


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@941 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-07-30 09:02:25 +00:00
Ozkan Sezer 53e10c7098 Avoid using COM_DefaultExtension() whenever possible: it may lead
to unpredictable results. Use a new procedure COM_AddExtension()
which appends the given extension to the path if the one it has,
if any, doesn't match. In Host_Game_f(), reject "." as the path.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@902 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-04-26 07:50:54 +00:00
Ozkan Sezer 5e4849c61f replace all ctype.h functions/macros and strcasecmp/strncasecmp()
by locale-insensitive versions, new header q_ctype.h.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@868 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-09-25 17:01:40 +00:00
Ozkan Sezer 87c24f75ff minor tidy-ups
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@829 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-02 12:03:52 +00:00
Sander van Dijk 2b49965af0 host_cmd.c: fix typo in r827
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@828 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-02 10:36:28 +00:00
Ozkan Sezer eb8e1beed3 host_cmd.c (Host_Changelevel_f, Host_Restart_f): if the serverspawn
fails even with an existing map, issue a Host_Error().

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@827 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-02 10:29:26 +00:00
Ozkan Sezer ee2b6ce55a fixed fitzquake's map existence check in Host_Changelevel_f () leaking
file handles which would end up in a Sys_Error () due to consuming all
free handles if many maps reside not in pak files.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@825 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-01 23:55:12 +00:00
Ozkan Sezer dbdd675552 renamed model_t to qmodel_t in order to avoid conflicts on solaris.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@676 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-05-30 08:56:06 +00:00
Ozkan Sezer d9711fdfa2 Limited the struct qsocket_s details only to net_*.c sources :
For menu serverlist handling, added new procedures NET_SlistSort,
NET_SlistPrintServer and NET_SlistPrintServerName. Added new
procedure NET_QSocketGetTime for status and spawn commands' print
functionality in host_cmd.c. Added new NET_QSocketGetAddressString
procedure for status and connect commands' print functionality in
host_cmd.c and sv_main.c.  Patch ported over from uhexen2.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@657 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-04-18 20:33:12 +00:00
Ozkan Sezer 19953bd399 silenced -Wsign-compare warnings.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@575 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 19:06:08 +00:00
Ozkan Sezer fb2f45126e changed many strcpy and strncpy into q_strlcpy
and strcat and strncat into q_strlcat

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@560 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 13:15:31 +00:00
Ozkan Sezer 983af887bf changed many sprintf() calls into q_snprintf().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@557 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 10:50:42 +00:00
Ozkan Sezer 07b572b642 better buffer size safety with COM_StripExtension, COM_FileBase and COM_DefaultExtension
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@554 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 08:04:02 +00:00
Ozkan Sezer abd0089b8a host_cmd.c (Host_Loadgame_f): Close the file before signalling an error
(noticed this in recent RMQ sources.)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@518 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 06:31:51 +00:00
Ozkan Sezer 2b919188d6 renamed Sys_FloatTime to Sys_DoubleTime (the thing always returned double
you know..) and adjusted all callers accordingly.  changed Sys_Sleep() to
take a milliseconds argument, added implementations for unix (usleep) and
windows (Sleep).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@512 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 16:01:01 +00:00
Ozkan Sezer 1363a0cced removed privileged member from the client structure
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@506 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 09:50:23 +00:00
Ozkan Sezer 7dd3ee7a58 moved Host_Version_f from host_cmd.c to host.c.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@463 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-27 13:20:52 +00:00
Ozkan Sezer a85d8dcd6a made global host_parms a pointer, set in main(). adjusted places where
host_parms is used. made COM_Init() and Host_Init() to take no arguments.
made Sys_Init() to set host_parms->userdir: at present, it is set to
host_parms->basedir, to be changed properly when user directories are
implemented.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@443 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-19 16:41:45 +00:00
Ozkan Sezer 945262b863 min/max macros: renamed them to q_min and q_max, moved them common.h.
removed the inline versions which only handled integers.  moved CLAMP
macro to common.h.  Adjusted all places for the renamed macros.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@386 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 10:35:40 +00:00
Ozkan Sezer c583b5b541 common.c (searchpath_t): Added new member `path_id', an unsigned
int identifier assigned to the game directory. Remember that main
<install_dir>/game1 and the unix <userdir>/game1 have the same id.
The id starts as 1 for the first data1 directory. For every new
directory, the value is the left-shifted version of the previous
one.  Made COM_FindFile() to accept a path_id pointer argument
and storing the id in it if it isn't NULL. Made COM_OpenFile(),
COM_FOpenFile() and all COM_Load* functions to accept a path_id
pointer argument similarly. Adjusted callers accordingly.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@370 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:45:16 +00:00
Ozkan Sezer 54dcec831b host_cmd.c: minor tidy up, nothing serious.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@318 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-31 12:15:38 +00:00
Ozkan Sezer 927fdb2ac6 host_cmd.c (Host_Say_f, Host_Tell_f): adjustments, mostly inspired from
the darkplaces engine.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@317 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-31 11:55:55 +00:00
Ozkan Sezer 6c62d1f9c5 fixed lazy declaration and cleaned up the .bsp extension removal logic.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@315 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-30 02:51:21 +00:00
Ozkan Sezer 71eda66cdc remove the defunct cls.mapstring
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@314 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-30 02:15:22 +00:00
Steven 55764a6111 Remove any trailing ".bsp" from mapname
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@313 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 23:03:50 +00:00
Steven dd590862a0 End of the world commit
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@312 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 21:37:07 +00:00
Ozkan Sezer f17e534519 added comment in Host_Name_f()
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@301 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 10:22:17 +00:00
Ozkan Sezer 906df3f650 const correctness changes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@300 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 02:22:55 +00:00
Ozkan Sezer 3a6e17e627 added q_stdinc.h, adapted from uhexen2, to tidy up several includes and
macros in one place.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@277 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-14 20:55:39 +00:00
Ozkan Sezer d5e85a5e6c host_cmd.c, menu.c: sanitize whitespace/formatting.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@252 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-02 19:45:16 +00:00