Commit graph

164 commits

Author SHA1 Message Date
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
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
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
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
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
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
Yamagi Burmeister
3bd64f2da0 Remove superflous statement
This was originaly committed into baseq2 by svdijk
2013-04-29 18:20:11 +02:00
Yamagi Burmeister
a7e3e4b445 Fix a typo in a function prototype in game.h
This is a merge of 909e694 from baseq2, original
written by svdijk.
2013-04-29 18:09:09 +02:00
Yamagi Burmeister
3f1380caac Fix direct loading of xware in coop
A superfluous unnamed info_player_start screwed up the info_coop_start
selection heuristic. It's unneeded in coop play, therefor remove it.
2013-03-24 09:37:40 +01:00
Yamagi Burmeister
5ca8d29816 Fix manuell loading of most maps in coop mode
This changes ports my magic "find the right coop spawnpoint if target is
unset"-heuristic from baseq2 to Xatrix. This code was originally written
by me and is hereby licensed (additionally to the GPL) to the Quake II
SDK license.
2013-03-10 11:58:29 +01:00
Yamagi Burmeister
05931b1520 Add back frames lost somewhere on the run 2013-02-18 18:25:53 +01:00
Yamagi Burmeister
00f0bb8df1 Remove superfluous whitespaces and end of lines
With this commit 'xatrix' is cleaned up. Every single line was audited,
many bugs removed and hundered of sanity checks added. Additionally the
code was reformated. All in all 'Xatrix' should now be much more
reliable and for the first time in ~15 years completeable without any
crashes, logic bugs or the like. Until now about 130 hours spread over
more than a year were spend for this project.

Of course this code is totaly untested. The next step is testing,
testing and testing. After that the spawn points needs to be fixed
so that all maps can pe started by "map $mapname".
2013-02-12 18:49:17 +01:00
Yamagi Burmeister
1fb978cfeb Cleanup tank and add sanity checks 2013-02-12 18:35:56 +01:00
Yamagi Burmeister
46e0ce8dbf Cleanup supertank and add sanity checks 2013-02-12 18:18:36 +01:00
Yamagi Burmeister
9d754f2f0f Cleanup soldier and add sanity checks 2013-02-11 19:04:21 +01:00
Yamagi Burmeister
2e058a591f Cleanup parasite and add sanity checks 2013-02-11 18:31:57 +01:00
Yamagi Burmeister
f7681706f1 Cleanup mutant and add sanity checks 2013-02-11 18:23:48 +01:00
Yamagi Burmeister
98c08b133d Cleanup player.h 2013-02-10 19:16:10 +01:00
Yamagi Burmeister
4c82759f3e Cleanup medic and add sanity checks 2013-02-10 19:16:10 +01:00
Yamagi Burmeister
9050175fbb Cleanup move.c and add sanity checks 2013-02-10 19:15:58 +01:00
Yamagi Burmeister
18b1ea93c9 Cleanup insane and add sanity checks 2013-02-10 18:38:49 +01:00
Yamagi Burmeister
a9b1370e93 Cleanup infantry and add sanity checks 2013-02-10 18:18:52 +01:00
Yamagi Burmeister
bc94f1afb3 Cleanup hover and add sanity checks 2013-02-10 18:06:37 +01:00
Yamagi Burmeister
56d613e7b6 Cleanup gunner and add sanity checks 2013-02-10 17:56:14 +01:00
Yamagi Burmeister
5ca949d991 Cleanup gladiator and add sanity checks 2013-02-03 12:36:01 +01:00
Yamagi Burmeister
fd7d60680e Cleanup gekk and add sanity checks 2013-02-03 09:49:13 +01:00
Yamagi Burmeister
e118c43e34 Cleanup flyer and add santiy checks 2013-02-03 09:22:28 +01:00
Yamagi Burmeister
0d857f224c Cleanup float and add sanity checks 2013-02-02 17:54:53 +01:00
Yamagi Burmeister
9c3e5862cd Clean up flipper and add sanity checks 2013-02-02 17:39:59 +01:00
Yamagi Burmeister
7a52e4a8ae Cleanup fixbot and add sanity checks 2013-02-02 11:05:32 +01:00
Yamagi Burmeister
d2451f5858 Cleanup chick and add sanity checks 2013-02-02 10:44:04 +01:00
Yamagi Burmeister
cc73698b20 Cleanup brain and add sanity checks 2013-02-02 10:29:29 +01:00
Yamagi Burmeister
6222a4174d iCleanup boss5 and add sanity checks 2013-02-02 10:14:13 +01:00
Yamagi Burmeister
4d30309345 Cleanup boss3 and add sanity checks 2013-02-02 10:00:32 +01:00
Yamagi Burmeister
d36bc419d2 Clean up boss2 and add sanity checks 2013-02-02 09:22:07 +01:00
Yamagi Burmeister
3bb1966788 Cleanup the berserker and add sanity checks 2013-01-15 18:45:25 +01:00
Yamagi Burmeister
53a0fc1f5d Remove monster/actor
The "actor" entity are player models moving on scripted pathes,
emulating NPC. They were never finished and thus are used in the
game. In theory the functions shouldn't be referenced anywhere
and thaerefor this change shouldn't break existing savegames.
But I'll habe to check if that stands in praxis.
2013-01-13 10:33:11 +01:00
Yamagi Burmeister
b7c935b2a7 Clean up local.h 2013-01-13 10:25:01 +01:00
Yamagi Burmeister
1a9b6acd81 Cleanup game.h 2013-01-13 10:04:31 +01:00
Yamagi Burmeister
9a29fee404 Add back the coop spawnpoint functions
Those are necessary to preserve savegame compatiblity and
maybe we'll need then anyway...
2013-01-06 15:53:37 +01:00
Yamagi Burmeister
2fd39786b9 Cleanup weapon.c and add sanity checks 2013-01-06 15:53:37 +01:00
Yamagi Burmeister
39cbfb5f0c Cleanup view.c and add sanity checks 2013-01-06 15:53:37 +01:00
Yamagi Burmeister
0ac8329672 Cleanup trail.c and add sanity checks 2013-01-06 15:53:37 +01:00
Yamagi Burmeister
b8052668b2 Cleanup hud.c and add sanity checks 2013-01-06 15:53:37 +01:00
Yamagi Burmeister
09a9023fe3 Cleanup client.c, add sanity checks and rip baseq2 stuff out 2013-01-06 15:53:37 +01:00
Yamagi Burmeister
8c53db8c05 Cleanup g_weapon.c and add sanity checks 2013-01-05 17:27:08 +01:00
Yamagi Burmeister
a96616d85f Cleanup g_utils.c and add sanity checks 2013-01-05 16:56:44 +01:00
Yamagi Burmeister
b6b88565ef Cleanup g_turret.c and add sanity checks 2013-01-05 14:57:53 +01:00
Yamagi Burmeister
93563d1541 Cleanup g_trigger.c and add sanity checks 2013-01-05 14:31:42 +01:00
Yamagi Burmeister
abcd2d98c7 Clean up g_target.c and add sanity checks 2013-01-05 13:54:21 +01:00
Yamagi Burmeister
81adfbff59 Clean g_svcmds.c up and add sanity checks 2013-01-05 13:30:05 +01:00
Yamagi Burmeister
214bd0a6f5 Clean up g_spawn.c and add sanity checks 2013-01-05 13:24:38 +01:00
Yamagi Burmeister
437c52de42 Cleanup g_phys.c and add sanity checks 2013-01-05 13:15:15 +01:00
Yamagi Burmeister
8caf0ff519 Cleanup g_monster.c and add sanity checks 2013-01-05 12:58:11 +01:00
Yamagi Burmeister
6e48d1aa2a Merge branch 'master' into cleanup
Conflicts:
	CHANGELOG
	src/g_combat.c
	src/g_func.c
	src/g_items.c
2013-01-05 12:34:59 +01:00
Joshua Scoggins
b0d33ae5ad Added sparc64 support to the ARCH string of savegame.c 2012-11-30 20:57:46 -08:00
Joshua Scoggins
3ef341a21a Added OpenBSD and MacOS X to savegame.c
Now the OS field will be correct when dealing with OSX and OpenBSD
2012-11-30 20:55:26 -08:00
Joshua Scoggins
18b4b74f56 Added ia64 to the arch define of savegame.c 2012-11-30 20:48:23 -08:00
Yamagi Burmeister
834e3c7846 Fix several warnings to enable a clean Windows build 2012-06-30 19:45:36 +02:00
Yamagi Burmeister
7a5414243a Add Windows platform define 2012-06-26 14:56:01 +02:00
Yamagi Burmeister
68d43b4bc5 Use randk() instead of rand() 2012-06-26 14:36:40 +02:00
Yamagi Burmeister
88bbdc4779 Sync shared.c and shared.h with baseq2, import rand.c 2012-06-26 14:33:37 +02:00
Yamagi Burmeister
ad3fe0b674 Prevent potential division by zero 2012-06-26 14:22:07 +02:00
Yamagi Burmeister
3e063fe549 Fix potential nulllpointer dereferences 2012-06-26 14:17:18 +02:00
Yamagi Burmeister
0226b07f48 Remove several dead assignements 2012-06-26 14:11:56 +02:00
Yamagi Burmeister
aed38232d3 Fix logic bug (found by caedes and his compiler) 2012-06-26 13:22:03 +02:00
Yamagi Burmeister
f29e0c6ca6 Fix logic bug (found by caedes and his compiler) 2012-02-22 11:47:14 +00:00
Yamagi Burmeister
e8f166520e Cleanup g_misc.c and add sanity checks 2011-10-18 10:00:46 +00:00
Yamagi Burmeister
c48f0633b3 Cleanup g_main.c and add sanity checks 2011-10-18 09:32:11 +00:00
Yamagi Burmeister
462d5a8610 Remove unused functions 2011-10-18 09:23:57 +00:00
Yamagi Burmeister
a9162b17f5 Cleanup g_items.c and add sanity checks 2011-10-18 09:21:30 +00:00
Yamagi Burmeister
ea92f471e4 Cleanup g_func.c and add sanity checks 2011-10-18 09:01:54 +00:00
Yamagi Burmeister
a04f4d9afe Cleanup g_combat.c and add sanity checks 2011-10-18 08:41:30 +00:00
Yamagi Burmeister
b6a4204049 Cleanup g_cmds.c and add sanity checks 2011-10-18 08:34:04 +00:00
Yamagi Burmeister
848fbea4ce Cleanup g_chase.c and add sanity checks 2011-10-18 08:28:12 +00:00
Yamagi Burmeister
f0a577d6b7 Reformat g_ai.c and add sanity checks 2011-10-18 08:23:19 +00:00
Yamagi Burmeister
ff6254c4b0 Fix nuking of blocking entities and let the killbox work correctly 2011-10-12 07:47:18 +00:00
Yamagi Burmeister
de831a67a4 Add missing savegame tables and fileheaders 2011-10-11 14:04:22 +00:00
Yamagi Burmeister
62f3b1319f Rearrange files and add a new Makefile 2011-10-11 14:00:27 +00:00
Yamagi Burmeister
e78bcb1cd2 Port the fixed savegame system from quake 2 2011-10-11 13:23:25 +00:00
Yamagi Burmeister
ec9958f82a Calculate a real bounding box for rotating entities 2011-10-11 13:21:59 +00:00
Yamagi Burmeister
9e03494cfb Don't crash when there is too much gibs or debris 2011-10-11 13:18:40 +00:00
Yamagi Burmeister
8a29fa1c66 Remove static. 2011-10-11 10:07:52 +00:00
Yamagi Burmeister
f455f1fed6 Initialize some variables 2011-07-02 08:35:07 +00:00
Yamagi Burmeister
eec6f17dff Behebt einen potentiellen Nullpointer beim Herausfinden, ob der Spieler
vor einem Monster steht.
2011-01-23 14:40:50 +00:00
Yamagi Burmeister
13a7258453 Ändere einige Details in der Ausgabe der Spiele 2010-10-27 13:33:37 +00:00
Yamagi Burmeister
c96e9bf140 Fix infantry shooting animation 2010-10-01 15:57:39 +00:00