Commit graph

44 commits

Author SHA1 Message Date
BjossiAlfreds
a4fba01b97 Console warning and fix triggered monsters with no targetname 2021-03-28 17:00:26 +00:00
Yamagi
b0303c1098 Add a cvar g_footsteps to control the generation of footstep sound.
1: The Vanilla Quake II behaviour, footsteps are generated when the
   player is faster than 255.
0: Footstep sounds are never generated.
2: Footstep sounds are always generated.

Defaults to `1`
2021-03-02 15:20:43 +01:00
Denis Pauk
0d2d20fc6e Fix function prototypes 2021-01-26 21:20:39 +02:00
Daniel Gibson
b92383eff9 Fix architecture detection on Windows in Makefile, bump SAVEGAMEVER
$PROCESSOR_ARCHITECTURE seems to contain the architecture of the host,
but we need the architecture the current MinGW shell is targeting.
$MINGW_CHOST seems to be just that, and on my system it's either
i686-w64-mingw32 (mingw32.exe) or x86_64-w64-mingw32 (mingw64.exe)
(No idea what it looks like for Windows on ARM...)

As fixing this would otherwise break existing savegames, I bumped the
SAVEGAMEVER to "YQ2-5" and added a quirk for older savegameversions:
On Windows i386 savegames that contain "AMD64" instead of "i386" as
architecture are also accepted.
(For YQ2-2 this didn't seem necessary, apparently "i386" was hardcoded)
2021-01-14 03:05:15 +01:00
Yamagi
e8f8a1309c Fix P_ProjectSource() forward declaration.
This was reported in yquake2#631.
2020-12-09 15:29:14 +01:00
Yamagi
9dfd9de811 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:22:31 +02:00
Yamagi
6820b0cad1 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 14:15:35 +02:00
Yamagi
73fd162dbe Bring Makefile on par with yquake2:
* Make CFLAGS and LDFLAGS overrideable
* Correct architecture and operating system detection.
* Enforce FPU mode.
* Implement DEBUG.
* Pass LDFLAGS after the objects.
* Rename OSTYPE and ARCH to YQ2OSTYPE and YQ2ARCH to avoid collisions.
2020-04-21 13:56:47 +02:00
Mitchell Richters
95e432d604 Implement accurate-aiming CVAR in rogue game code. 2020-04-21 07:30:24 +10:00
BjossiAlfreds
e04bd67aa3 Parasite blocked attack bugfix and dead code elimination 2020-01-01 21:50:07 +00:00
BjossiAlfreds
fffd90af15 Safely use plane normal in touch funcs 2019-10-03 15:46:14 +00:00
Yamagi
9eead824c7
Merge pull request #51 from BjossiAlfreds/grenquad
Quad sound for quadded hand grenades and removed unused prox hand grenade stuff
2019-10-03 10:08:55 +02:00
BjossiAlfreds
4045f83cae Quad sound for quadded hand grenades and removed unused prox hand grenade stuff 2019-10-01 21:31:00 +00:00
BjossiAlfreds
51b1eeb6a9 Merge branch 'master' into pvs 2019-09-28 15:25:51 +00:00
Yamagi Burmeister
4466b3111a Add back blindfire support lost in 99073e.
This was lost at the very beginning, when I first merged the baseq2 and
xatrix bugfixes into rogue. I did that by hand, not with my infamous
cleanup script. That came later for the big cleanup before version
2.00... For some reason my playstyle has a very low chance to trigger
blindfiring, so I never realized that it's missing and wasn't able to
reproduce the problem when it was reported in yquake2/yquake2#435.

Reported by @BjossiAlfreds in #34, closes #34.
2019-09-28 17:08:36 +02:00
Yamagi
b059224bc3
Merge pull request #49 from BjossiAlfreds/mutant
Restored mutant rogue features
2019-09-28 17:05:53 +02:00
Yamagi
65ea25f58e
Merge pull request #47 from BjossiAlfreds/float
Restored floater rogue features
2019-09-28 17:01:52 +02:00
Yamagi
f5d5331b8a
Merge pull request #43 from BjossiAlfreds/berserker
Restored berserker rogue features
2019-09-28 16:57:25 +02:00
BjossiAlfreds
2c9565314b Restored mutant rogue features 2019-09-28 03:47:30 +00:00
BjossiAlfreds
c7b32d15b4 Restored floater rogue features 2019-09-28 03:05:02 +00:00
BjossiAlfreds
2c475d1dc5 Restored berserker rogue features 2019-09-27 22:48:03 +00:00
BjossiAlfreds
72922a60cc Restored blocked code for gladiator 2019-09-27 21:59:03 +00:00
BjossiAlfreds
01c20df240 Merge branch 'master' into pvs 2019-09-26 14:02:30 +00:00
BjossiAlfreds
c2188ed5f6 Investigated PVS report for monster code and addressed a number of issues 2019-09-25 19:01:47 +00:00
BjossiAlfreds
9642eec016 coop_baseq2 added and fully functional 2019-09-23 16:41:29 +00:00
Yamagi Burmeister
9989340968 Add back the disruptor / desintegrator.
Make the disruptor and it's ammo available by 'give disruptor' and 'give
rounds'. If g_disruptor is set 0 (the defaults) neither the weapon, nor
the ammo is spawned in, if set to 1 it behaves like a normal weapon.
Based upon an idea by @NeonKnightOA submitted in PR #18.

This was requested in issue #17.
2019-06-11 14:07:48 +02:00
Yamagi Burmeister
eaaf6c43d4 Fix a missmerge, save_ver is supported since version 4 and not 3. 2019-02-05 09:05:18 +01:00
Yamagi Burmeister
063776d504 Save gclient_t::resp.coop_respawn.*weapon to fix coop savegames
This fixed bug #357 - the problem was that
client->resp.coop_respawn.weapon and .lastweapon (pointers to gitem)
were not properly initialized when loading a savegame.
Now those fields are saved (=> we had to bump the savegame version)
and for old savegames client->resp.coop_rewspawn is initialized
from client->pers, as a hack for backwards-compatibility.
2019-02-04 10:50:23 +01:00
Yamagi Burmeister
b58a3ae131 Make sure that strings are null terminated.
This is a noop, it just adds some safety. This was reported by maraakate
in yquake2 issue #160.
2016-12-17 10:44:56 +01:00
Yamagi Burmeister
6467137619 Switch from an arch whitelist to an "all archs are supported" approach.
The old whitelist was a leftover from the early days of YQ2. It should
run on most / all architectures, as long SDL supports them. As suggested
by smcv in issue #138 generate the OSTYPE and ARCH defines by the build
system instead of hardcoding it.

Savegame compatibility is provided by bumping the savegame version. Old
savegames are compared against the old OSTYPE and ARCH defined, new ones
against the new defines. This compatibility code should be removed
somewhere in the distant future.
2016-06-11 09:47:05 +02:00
Yamagi Burmeister
be3472d045 fix several printf format string errors in games' code
Submitted by: Ozkan Sezer
2015-08-31 18:36:18 +02:00
Daniel Gibson
7929e845d3 Fix bug with high velocities in vents in 32bit builds, fix MingW build
See https://github.com/yquake2/yquake2/issues/71
and https://github.com/yquake2/xatrix/issues/4

In ClientThink(), the float value ent->velocity[i]*8 is saved into
a short and if the value is too big for a short, in 32bit gcc builds
the short is set to SHRT_MIN, resulting in the player being pressed
down instead of up.
Now we put the result in a 32bit int first (which should be big enough)
and assign the int to the short. This still overflows, but with -fwrapv
at least in a defined way (most probably the same way the original
binaries did).

The Makefile now sets $CC to gcc for MingW builds, this should fix
https://github.com/yquake2/xatrix/issues/3

And while I was at it, when the game lib is loaded, it prints the date
it was built, this is especially interesting for our Win32 binaries.
2015-05-17 18:40:49 +02:00
Daniel Gibson
bcbae17d9c Fix Coop Bug in RHANGAR1 when friendly fire was off
In RHANGAR1 the turret didn't blow up the ceiling when friendly fire
was off, because in ClientTeam() both entities were set to "" (no team),
but OnSameTeam() just did a strcmp() instead of checking this special
case (no team).
We check this now and thus it works. Hooray.

The savegame table entry for this function was invalid, but it doesn't
need to be saved anyway, so I just deleted it from the table.
2014-11-30 17:50:34 +01:00
Yamagi Burmeister
8dd8520ddc Rewrite COM_FileExtention()
COM_FileExtension() was parsing strings from beginning to end, bailing
out as soon as '.' was found and treating everything thereafter as the
file extension. That behavior caused problem with relatives pathes
like models/monsters/tank/../ctank/skin.pcx. The new implementation uses
strrchr() to determine the last '.'.
2014-07-30 21:44:21 +02:00
Yamagi Burmeister
bac51c8d95 Whitespace cleanup 2014-02-22 13:20:22 +01:00
Yamagi Burmeister
926c38ac1b Fix help computer and inventory updates when already opened
These changes ware originally committed by svdijk into baseq2
as reveison 6f6c9a1 to 20110fa.
2014-02-22 13:14:02 +01:00
Yamagi Burmeister
e53422065e Add functions of Deadalus and Medic Commander
This brings the necessary changes to the savegame tables for being able
to save levels with an Deadalus or Medic Commander. Since this breaks
savegame compatiblity, bump the savegame version. *sigh*
2014-02-11 19:07:27 +01:00
Yamagi Burmeister
d97357f177 Remove actor
The actor was a special "monster" used für simulating NPC. It was never
fully implemented and therefor disfunctional. Thus it was never used in
any map. Remove it like done in baseq2 and xatrix.
2014-02-02 18:40:34 +01:00
Joshua Scoggins
49288378bf Added the sparc64 ARCH tag to savegame.c 2012-11-30 20:59:47 -08:00
Joshua Scoggins
b741f8adb1 Added OpenBSD and MacOS X support to savegame.c 2012-11-30 20:59:07 -08:00
Joshua Scoggins
16e11b2ae4 Added an ia64 ARCH string to savegame.c 2012-11-30 20:45:48 -08:00
Yamagi Burmeister
2482849546 Add platform defines for windows 2012-06-27 14:54:27 +02:00
Yamagi Burmeister
489ab02814 Rearrange source and rework Makefile 2011-10-11 11:40:43 +00:00
Yamagi Burmeister
d1c7849ef1 Port the new savegame system from quake 2 2011-10-11 10:53:48 +00:00