Commit graph

171 commits

Author SHA1 Message Date
Yamagi Burmeister
618953fbdd Replace strcasecmp() by Q_strcasecmp() for better MSVC compaibility.
This was suggest by @ajbonner in issue #11.
2018-03-23 15:54:14 +01:00
Yamagi Burmeister
a9b24bfa04 Fix a potential crash in ai_run_melee() and ai_run_missile().
This was found and fixed by Maraakate.
2017-09-07 18:09:25 +02:00
Yamagi Burmeister
99a032c6ae Enforce static linkage of libgcc on Windows. 2017-06-16 12:49:41 +02:00
Yamagi Burmeister
173892c2dc Update the CHANGELOG for 2.05. 2017-05-25 11:46:23 +02:00
Yamagi Burmeister
12480710e6 Add some maphack that're specific to coop.
These are some corner cases that can only happen when one or both
players die at the wrong place and time. This is based upon a fix by
Maraakate. This fixes issue #9.
2017-03-13 15:06:49 +01:00
Yamagi Burmeister
76a2d97569 The attack function for brains was missing, add it back.
This was likely lost in some merge or cleanup. Reported by maraakate
in issue #8.
2017-03-13 14:32:00 +01:00
Yamagi Burmeister
cc3b204e5a Add a missing sanity check. attacker->classname may be NULL.
This was reported by maraakate in issue #170.
2017-03-13 14:28:06 +01:00
Yamagi Burmeister
2cda032cee Fix a small typo: s/withe/with/1
Reported by @lonkamikaze in IRC
2017-02-11 13:23:57 +01:00
Yamagi Burmeister
80fb945cff Make sure that a monsters enemy is still alive when deciding to attack.
When the monster was already killed by another monster or a coop player
some references may be NULL and the game was crashed. This was observed
by maraakte, who reported it in issue #164. I've just merged his fix
from q2dos.
2016-12-30 10:25:22 +01:00
Yamagi Burmeister
d98e1b9eb0 Add some missing sanity checks.
This was reported by Maraakate in yquake2 issue #164.
2016-12-28 18:04:14 +01:00
Yamagi Burmeister
d3f299cca6 Reorder conditionals to please unoptimizing compilers
This was requested by Maraakate. This is likely a noop, since even
early compilers from th 1970th supported simple optimiziations like
this.
2016-12-20 15:21:24 +01:00
Yamagi Burmeister
3f66dec8c8 Use strtod() instead of strof() to aid VS2005 2016-12-18 10:19:35 +01:00
Yamagi Burmeister
77536e07d8 Change edict_s->show_hostile from qboolean to int and add casts
This variable is used as an integer. Defining it as a qbooblean is
just wrong. Add some explicit float -> int casts while at it.
2016-12-18 09:17:54 +01:00
Yamagi Burmeister
1bea78c4ec Rename teleport_time to last_sound time
teleport_time has nothing to do with teleports, it's just the time
since the last player sound. Rename it accordingly. This was suggest
by maraakate in yquake2 issue #162.
2016-12-18 09:16:28 +01:00
Yamagi Burmeister
20cdbfe1c0 Fix monsters ignoring the player under certain circumstances
In ai_checkattack() is a check against AI_SOUND_TARGET. If the player
made a noice and the the monster noticed this noise it's true. If
that noice was more than 5 seconds ago the monster forgets that event
and continues with it's search for the player. Otherwise it informs
the surrounding monsters that something interesting has happened and
then returns false. So the problem is: Even if the monster heard the
player and can see him, it aborts at this point.

Fix this by adding an additional visibility check. Do the sound
checking only if the player is not visible, otherwise just continue.

This was reported by shoober420 and debbuged by maraakate. This fix
was DanielGibons idea. This commit fixes yquake2 issue #162.
2016-12-18 09:15:21 +01:00
Yamagi Burmeister
60321a282f 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 11:09:09 +01:00
Yamagi Burmeister
8ad1ba53d6 Change from atoi() to strtol() to match baseq2.
This is a noop. This was reported by maraakate in yquake issue #160.
2016-12-17 11:08:00 +01:00
Yamagi Burmeister
5c004e2c22 Take into account that the player origin may not be in his center
This is another corner case that looks more correct in baseq2. This was
reported by maraakate in yquake2 issue #160.
2016-12-17 11:06:40 +01:00
Yamagi Burmeister
fe0f0ad86f In M_CheckGround() use the trace velocity.
I have no clue what this is about. But when in doupt baseq2 is right...
:) This was reported by maraakate in yquake2 issue #160.
2016-12-17 11:05:52 +01:00
Yamagi Burmeister
0e00bb0d9f Only start monsters with max_health == health if max_health isn't set.
I dont' know if any monsters start with max_health != health, but this
looks more correct. This was reported by maraakate in yquake2 issue 160.
2016-12-17 11:04:34 +01:00
Yamagi Burmeister
be91d27005 In ED_ParseField() replace atof() with strtof().
On most implementations atof() is just a wrapper around strtod().
Calling strtof() saves one cast. For the sake of cinsistency change
atoi() to (int)strtol(), it's a noop. Reported by maraakate in
yquake2 issue #160.
2016-12-17 11:02:18 +01:00
Yamagi Burmeister
4285702803 Use Q_strcasecmp instead of Q_stricmp().
This should be be noop but looks safer. Reported by maraakate in yquake2
issue #160.
2016-12-17 10:58:50 +01:00
Yamagi Burmeister
48a06ef31e Add missing sanity checks in ED_ParseEdict() and ED_NewString().
This was reported by maraakate in yquake2 issue #160.
2016-12-17 10:57:32 +01:00
Daniel Gibson
8a9b33612a Make debris SOLID_NOT
in baseq2 this caused bug #154
2016-10-24 17:29:11 +02:00
Daniel Gibson
d1e811bd5b Fix typo in ai_checkattack() leading to monsters running in place
this is the fix from yquake2/#151
2016-10-23 18:28:36 +02:00
Yamagi Burmeister
6034d77bbe Generate game.dylib on OS X. Fixes #148. 2016-08-14 16:23:09 +02:00
Yamagi Burmeister
92be77cd83 Update CHANGELOG 2016-06-25 10:35:59 +02:00
Yamagi Burmeister
7e03dfaac2 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:35:10 +02:00
Yamagi Burmeister
741e98028e Make gibs and debris SOLID_BBOX so they move on entities. 2016-04-29 17:42:02 +02:00
Yamagi Burmeister
291d9852ee Reset gibsthisframe and lastgibframe at map change
Without this change the conditionals at g_misc.c:199 and 381 wouldn't
trigger until level.framenum reach it's previous value, resulting in
much to few debris or gibs being thrown. This fixes #104.

Many thanks to maraakate for the analysis and the idea how to fix it.
2015-10-24 13:30:41 +02:00
Yamagi Burmeister
ef8882e106 Another CHANGELOG update 2015-09-08 17:13:04 +02:00
Yamagi Burmeister
79b3261c29 Update CHANGELOG 2015-09-07 17:18:02 +02:00
Yamagi Burmeister
85c0dcb954 fix a divinely dumbassed mistake of global 'i' and 'corners' variables
Submitted by: Ozkan Sezer
2015-08-31 18:28:29 +02:00
Yamagi Burmeister
8272c04046 use memmove instead of strcpy for overlapping memory areas.
Submitted by: Ozkan Sezer
2015-08-31 18:27:47 +02:00
Yamagi Burmeister
5d8b2ae701 SV_Physics_Pusher: fix the 'memory corrupted' check
Submitted by: Ozkan Sezer
2015-08-31 18:26:10 +02:00
Yamagi Burmeister
6d07abecc4 fix several printf format string errors in games' code
Submitted by: Ozkan Sezer
2015-08-31 18:25:16 +02:00
Yamagi Burmeister
d8f1c5587c fix misplaced braces in the last else case
Submited by: Ozkan Sezer
2015-08-31 18:21:04 +02:00
Yamagi Burmeister
c107df476c Remove unused GetGameAPI() prototype
Submitted by: Ozkan Sezer
2015-08-31 18:19:31 +02:00
Yamagi Burmeister
906b89e483 Add CMake support 2015-08-23 18:52:33 +02:00
Daniel Gibson
4b02b97332 Fix bug with high velocities in vents in 32bit builds, fix MingW build
See https://github.com/yquake2/yquake2/issues/71 and Xatrix #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 #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:42:56 +02:00
Daniel Gibson
150c521e13 One entity shooting another should work even if friendly fire is off
In rogue's 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.
I also refactored ClientTeam() to take the buffer instead of using a
static one and to be static (it's only called by OnSameTeam() anyway).

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:55:38 +01:00
Yamagi Burmeister
dd3bf3ee29 Use the correct flavor of abs() 2014-08-03 11:43:14 +02:00
Yamagi Burmeister
dd50746c4c 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:46:55 +02:00
Yamagi Burmeister
2e95fab925 Remove the now unneeded mkdir.exe 2014-02-14 10:35:46 +01:00
Yamagi Burmeister
a549b5ef6d Port makefile to our new Windows build environment 2014-02-14 10:22:47 +01:00
Yamagi Burmeister
d5d771d373 Fix a progress stopper in xware.bsp 2013-06-15 16:18:31 +02:00
svdijk
fc5760bf99 help/score updates: fix typo 2013-05-04 14:51:09 +02:00
Yamagi Burmeister
c2d0cd97e5 Fix a typo 2013-05-01 09:43:50 +02:00
Yamagi Burmeister
fc85c85047 Update the CHANGELOG 2013-05-01 09:43:39 +02:00
Yamagi Burmeister
f7da445083 Fix help computer and inventory updates when already opened
These changes ware originally committed by svdijk into baseq2
as reveison 6f6c9a1 to 20110fa.
2013-04-29 18:42:17 +02:00