Commit graph

2933 commits

Author SHA1 Message Date
Yamagi
634748a5b5 Add missing return type for SV_ListMaps_f() 2020-08-23 10:34:52 +02:00
Daniel Gibson
93d1dfe60d Fix typo in Qcommon_Mainloop() that reduced performance, refs #591
We busy-looped for 5000 microseconds, i.e. 5 milliseconds, which reduces
the framerate to < 200fps
I guess the value was copypasted from Sys_Nanosleep() below, but
that was nanoseconds of course..
Anyway, busy-looping for 5 *micro*seconds instead fixes it.
2020-08-20 17:27:09 +02:00
Daniel Gibson
1d42dbc541 doc/090_filelists.md: Fix GOG music filelist
for GOG it's TrackXY.ogg, not just XY.ogg
2020-08-20 16:01:54 +02:00
Yamagi
0fdc3750e0
Merge pull request #589 from JoBergeron/listmap-cmd
added listmaps command
2020-08-20 07:19:27 +02:00
JBerg
ffe9997735 Documented the new listmaps console command 2020-08-19 21:14:53 -04:00
JBerg
b746f4520d added listmaps command 2020-08-18 23:18:22 -04:00
Yamagi
1f3f796322 Add cl_anglekick, when set to 0 angle kicks are ignored.
Angle kicks are used for weapon recoil, damage kicks and the like.
Setting the `cl_anglekicks` to `0` ignored them, they're read from
the network but not displayed. The cvar is cheat protected, it's
reset to `1` on server connect.

Rquested by Martin via mail.
2020-08-17 14:18:51 +02:00
Daniel Gibson
fd0c058b2e Implemented coop_elevator_delay cvar (for func_plat)
In coop it's often hard to get on the same elevator together, because
they're immediately triggered once the first player steps on it.
This cvar sets a delay (1 second by default) for the elevator to wait
before moving, so other players have some time to get on it.
If you like elevators/platforms that suck, just set it to `0` :-P

Currently only used in func_plat, if it turns out that other entities
are used for automatically triggered platforms, we'll have to adapt
those as well (I guess wait_and_change() is generally useful for that).

We're not bumping the savegame version because they should only break in
an uncommon corner case: *Coop* savegames created with clients including
this change will not work on older clients - SP savegames are not
affected and old savegames on new clients also still work.
2020-08-10 14:27:35 +02:00
Yamagi
1a6dea5a0b Add coop_pickup_weapons, allow a weapon to be taken several times.
In coop a weapon can be picked up only once. That's annoying, because in
coop ammunition is sparse and not getting the ammunition that comes with
a weapons make things worse. When `coop_pickup_weapons` is set to `1` a
weapon may be picked up if:

1) The player doesn't have the weapon in their inventory.
2) No other player has already picked it up.
2020-08-10 13:52:33 +02:00
Yamagi
7ca55afffe
Merge pull request #585 from devnexen/backtrace_detection
backtrace support rework proposal.
2020-08-09 17:27:50 +02:00
David Carlier
1412d0201c Backport changes to old Makefile 2020-08-09 15:52:11 +00:00
David Carlier
0200434187 backtrace support rework proposal.
Linux/Solaris supports it in the libc however, BSD in general, Haiku
relies on an external library.
2020-08-03 10:19:41 +00:00
Yamagi
9136c8705a Fix lithium2 crashing at startup.
This is one these constructs which makes you wonder how it could ever
work. When querying a cvar by calling Cvar_Get(), the default value
(given in `var_value`) is copied into `cvar_t->default_string`. If a
NULL pointer is given in `var_value`, the NULL pointer is passed to
CopyString() and dereferenced. The game crashes. There's already a NULL
pointer check in the 'cvar wasn't found' branch, but none in the 'cvar
was found' branch... Moving the check to the beginning of the function
isn't an option, because at least lithium2 doesn't implement a NULL
pointer check either. We would just move the crash from the server into
the game.dll. Therefore copy an empty string into
cvar_t->default_string` when a NULL pointer was passed in `cvar_value`
and the cvar was found. Pass the empty string trough `CopyString()` to
get an Z_MAlloc() allocation for it, otherwise we would call `Z_Free()`
on an unallocated object further down below.

Reported by Chris Stewart.
2020-07-11 09:32:11 +02:00
Yamagi
2ab4e5553a Prevent music from playing even if ogg_enabled is 0.
ogg_enabled doesn't prevent music from playing, it just toggles if the
ogg backend should be enabled or not. If the user does something like
`ogg_enable=0; snd_restart` everything is okay. If they just set
`ogg_enable=0` strange things happen because the backend stays
initialized and will play tracks as requested. Work around the by
shutting the backend down if `ogg_enable == 0 && ogg_started == true`.

Closes #583.
2020-06-30 14:46:48 +02:00
Yamagi
06436d0d30 Bump the buffers used by the config file parser to 32k.
This allows really bug configuration files up to 32k. It would be better
to switch the global buffer to something allocated at runtime, but thats
non-trivial... This change should be save, since the buffers are global
(allocated in the BSS) and not included in savegames nor send over the
network.

Closes #582.
2020-06-30 14:13:14 +02:00
Yamagi
7439bdd45c
Merge pull request #581 from devnexen/haiku_port
Haiku porting proposal.
2020-06-26 16:12:34 +02:00
David Carlier
3e63226bad Translate changes to the Makefile build too 2020-06-26 12:43:06 +00:00
Yamagi
0491b54284 Force the dedicated server to use nanosleep() based waits.
It's an often reported, that the q2ded dedicated server consumes huges
amounts of CPU time. That's because users don't know that `busywait`
must be set to `0`. Since there's no point in using busywaits in the
dedicated server (the network jitter is always bigger than the
jitter caused by nanosleep() and equivalents), just force q2ded to
use nanosleep().
2020-06-26 12:46:40 +02:00
David Carlier
6c4187a6e3 using custom sting copy fn instead 2020-06-21 11:00:20 +00:00
David Carlier
a2b274d1a5 Haiku porting proposal. 2020-06-20 19:05:55 +00:00
Yamagi
ea0c0c04a2 Fix crash with some projectiles generating sound targets.
Some projectiles like grenades or rockets are classified as enemies.
Their explosion spawn a sound entity, monsters should move to that. But
the projectile is destroyed when exploding, it's entity struct is set to
NULL. Therefor the self->enemy pointer is also NULL. The self->enemy
check was removed in bc5f5698. Work around this by pretending that the
enemy is already there.

This was reported by @Soldy, closes yquake2/xatrix#56.
2020-06-04 08:12:36 +02:00
Yamagi
57f7ce86e8 Make ffe8f89 somewhat more readable and add a comment. 2020-06-02 08:31:02 +02:00
Yamagi
486441eb0e
Merge pull request #576 from pettyalex/macos-relative-linker-path
Enable rpath with Mac OS linker
2020-06-02 08:29:18 +02:00
Yamagi
ffe8f893ed Abort downloads if a server hasn't a file over UDP.
This is a special case, the bug was already present in Vanilla Q2: If a
server is offering assets for download but is missing some files the
USP download code runs in an endless loop. CL_ParseDownload() detects
that something is wrong and calls CL_RequestNextDownload() which tries
to download the same file again... Work around this by skippig over that
file.

This closes #552.
2020-06-02 08:03:06 +02:00
Alex Petty
a2d6cc9cdc Mac OS uses @executable_path not for rpath 2020-05-20 19:39:09 -05:00
Alex Petty
895c7bc850 Enable rpath with Mac OS linker 2020-05-20 19:30:52 -05:00
Yamagi
7f339952cb
Merge pull request #575 from kondrak/master
Fixed the Jorg skin bug present since the original Quake 2 release.
2020-05-11 12:59:06 +02:00
Yamagi
3c681210ba
Merge pull request #574 from 0lvin/for_review
fix tearing with fix palette change(explosion near without move)
2020-05-11 12:30:47 +02:00
Yamagi
93c0302d79
Merge pull request #572 from BjossiAlfreds/gunner-idle
Fix for gunner AI freeze bug
2020-05-11 11:42:40 +02:00
Yamagi
94caa85a64
Merge pull request #569 from bibendovsky/fix/508_liquid_shader
Move liquid transformations into fragment shader
2020-05-11 11:31:41 +02:00
Krzysztof Kondrak
6d9930fd75 Fixed the Jorg skin bug present since the original Quake 2 release. 2020-05-10 15:00:34 +02:00
Denis Pauk
ef841ce98c fix tearing with fix palette change(explosion near without move) 2020-05-09 14:11:12 +03:00
BjossiAlfreds
8de243a42f Fix for gunner AI freeze bug 2020-05-08 22:10:34 +00:00
Boris I. Bendovsky
0ae9f55089
Move liquid transformations into fragment shader 2020-05-04 22:42:08 +03:00
Yamagi
3492dff774
Merge pull request #564 from bibendovsky/fix/558_silenced_muzzle_flash
Don't play silenced muzzle flash sounds
2020-05-04 18:19:28 +02:00
Yamagi
33591ceb6e Update stb_vorbis to 37b9b20fdec06c75a0493e0bb59e2d0f288bfb51.
This fixes the crash reported in #568 for me.
2020-05-04 18:17:41 +02:00
Boris I. Bendovsky
93a0473244
Add cvar to control sorting of play sounds 2020-05-04 18:44:58 +03:00
Boris I. Bendovsky
1887072cc9
Merge remote-tracking branch 'upstream/master' into fix/558_silenced_muzzle_flash 2020-05-04 17:41:36 +03:00
Yamagi
8f2542e05f Limit the new order of the pending sound lists to baseq2 and the addons.
The new ordering was introduced in 16ee007, fixing some problems with
the wrong sound getting played when an entity triggers several sound at
the same timestamp. This broke the behavior of the mods, in #558 dday
was mentioned, muzzle flashe sound prevent the firing sound from getting
played.

Since we don't control the source of all mods, add a simple band aid
fix: Use the new ordering for baseq2, xatrix and rouge. Use the old
ordering for everything else.

An alternative approach is being discussed in #564.
2020-05-04 09:51:53 +02:00
Yamagi
1eca56a4a3
Merge pull request #566 from echoline/master
musl libc and uclibc do not have backtrace()
2020-04-27 12:52:45 +02:00
Linux User
c4e43f0403 musl libc and uclibc do not have backtrace() 2020-04-25 20:30:55 -07:00
Boris I. Bendovsky
4646859535
Don't play silenced muzzle flash sounds 2020-04-22 17:53:41 +03:00
Yamagi
563ef16ee3 Exec autoexec.cfg everytime game changes.
I don't remember why we restricted it to client startup. The original
code executed it everytime when `game` changed... Revert to that
behavior. Look here if some problems come up. ;)

Closes #544.
2020-04-21 14:06:16 +02:00
Yamagi
5455ffa96f s_doppler should default to 0.
The doppler effect is a game play change. And it's rather badly
implemented. Discussed in yquake2/xatrix#51.

Closes yquake2/xatrix#51.
2020-04-21 13:58:58 +02:00
Yamagi
00e6eb6303 Remove unnecessary OSX_ARCH setting, replace it with YQ2_ARCH. 2020-04-21 13:57:09 +02:00
Yamagi
beadebbdec Document aimfix. 2020-04-21 13:00:00 +02:00
Yamagi
f043db2a56
Merge pull request #562 from BjossiAlfreds/disruptor-doc
Added doc entry for g_disruptor cvar in GroundZero
2020-04-21 12:55:10 +02:00
Yamagi
73d0812d9f
Merge pull request #561 from mjr4077au/Client_AimFixWithCVAR
Implement accurate-aiming CVAR in baseq2 game code.
2020-04-21 12:54:32 +02:00
BjossiAlfreds
975298b3f2 Added doc entry for g_disruptor cvar in GroundZero 2020-04-21 00:28:51 +00:00
Mitchell Richters
85fb607010 Implement accurate-aiming CVAR in baseq2 game code. 2020-04-21 06:17:40 +10:00