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.
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.
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 '.'.
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.
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".
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.