Commit Graph

2696 Commits

Author SHA1 Message Date
Yamagi 2231268bc7
Merge pull request #603 from devnexen/code_simplification
Little simplification for NetBSD, /proc/<pid>/exe works just fine too.
2020-10-06 16:55:01 +02:00
David Carlier 6bb23c908f Little simplification for NetBSD, sysctl works just fine too. 2020-09-30 22:56:19 +01:00
Yamagi 41931d7a06
Merge pull request #599 from earth-metal/master
Create "mods" submenu to allow changing "game" cvar via UI
2020-09-12 16:11:26 +02:00
Yamagi 213a338d03
Merge pull request #598 from JoBergeron/map-autocomplete
map name autocompletion
2020-09-12 16:02:44 +02:00
earth-metal a4de026eb3 Create "mods" submenu to allow changing "game" cvar via UI
Combs all Raw search paths to find game dirs containing PAK/PK2/PK3
files.  If multiple uniquely-named directories exist, then show a "mods"
option on the "Game" menu and allow selection of desired mod on new
eponymous submenu.  Includes fix for memory leak of mapnames (read from
"maps.lst") when changing games.
2020-09-06 16:43:36 -04:00
JBerg a843ef416f map name autocompletion 2020-09-05 22:32:13 -04:00
Yamagi 408d019792
Merge pull request #595 from devnexen/haiku_simplification
Haiku support, code simplification.
2020-09-05 16:50:50 +02:00
David Carlier e4fac541a9 Haiku support, code simplification.
using more straightforward approach to get the current binary path.
Actual approach more fit to get other infos (e.g. address mappings and so on).
2020-09-01 11:27:26 +00:00
Yamagi 56ddda7021
Merge pull request #593 from devnexen/fbsd_mprotect
Hunk: FreeBSD set the map permission to max read and write
2020-08-31 13:31:03 +02:00
David Carlier 5e89f96067 Hunk: FreeBSD set the map permission to max read and write
which cannot be made executable afterwards.
2020-08-24 23:45:54 +01:00
Yamagi 2bb6fdf4a8
Merge pull request #592 from earth-metal/master
Start Server Menu: reload "maps.lst" after "game" dir is changed
2020-08-23 20:33:19 +02:00
earth-metal c31926ec90 Reset map list in "start network server" menu when "game" cvar changes
When the "game" directory is changed, clear the current list of maps in
the "start network server" menu so that it will be re-initialized the
next time the menu is accessed.
2020-08-23 14:06:01 -04:00
Daniel Gibson 37a5ca8a8d Make "wait" in scripts wait for >= 17ms, fix #591
so it waits for about the time of one frame at 60fps, but independently
of the actual framerate.
Without this fix, wait is broken unless vsync is on, because
CBuf_Execute() is called about 1000 times per second by Qcommon_Frame(),
even if no render- or packet-frame is executed.
(vsync "fixes" this because then we have a real wait at the end of each
 renderframe)
2020-08-23 17:21:20 +02:00
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