Commit graph

20 commits

Author SHA1 Message Date
Yamagi Burmeister
1d6e3f6eab Fix stupid missmerge, ReadField() may only be called once for a field. 2019-02-05 08:56:06 +01:00
Yamagi Burmeister
b830f28827 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 12:05:13 +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
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
6d07abecc4 fix several printf format string errors in games' code
Submitted by: Ozkan Sezer
2015-08-31 18:25:16 +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
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
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
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
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
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
7a5414243a Add Windows platform define 2012-06-26 14:56:01 +02:00
Yamagi Burmeister
462d5a8610 Remove unused functions 2011-10-18 09:23:57 +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