Commit graph

72 commits

Author SHA1 Message Date
David Carlier
4e97fe4c74 game data packing representation of the headers 2021-04-07 18:10:53 +01:00
Yamagi
f3912680ac
Merge pull request #16 from 0lvin/master
Fix compiler warnings
2021-01-27 08:28:07 +01:00
Denis Pauk
c88b0c1a9a Fix function prototypes 2021-01-26 20:55:54 +02:00
Denis Pauk
fda7c543b8 Fix compiler warnings
src/g_items.c:2869:6: warning: variable ‘index’ set but not used [-Wunused-but-set-variable]
src/g_phys.c:535:10: warning: variable ‘mins’ set but not used [-Wunused-but-set-variable]
src/g_phys.c:535:16: warning: variable ‘maxs’ set but not used [-Wunused-but-set-variable]
src/g_spawn.c:575:6: warning: variable ‘oldmaxent’ set but not used [-Wunused-but-set-variable]
src/g_target.c:537:6: warning: variable ‘effect’ set but not used [-Wunused-but-set-variable]
src/monster/boss2/boss2.c:564:11: warning: variable ‘enemy_infront’ set but not used [-Wunused-but-set-variable]
src/monster/boss3/boss31.c:601:8: warning: variable ‘range’ set but not used [-Wunused-but-set-variable]
src/monster/boss3/boss31.c:650:11: warning: variable ‘enemy_infront’ set but not used [-Wunused-but-set-variable]
src/monster/boss3/boss32.c:678:8: warning: variable ‘range’ set but not used [-Wunused-but-set-variable]
src/monster/boss3/boss32.c:811:11: warning: variable ‘enemy_infront’ set but not used [-Wunused-but-set-variable]
src/monster/boss/boss.c:797:8: warning: variable ‘length’ set but not used [-Wunused-but-set-variable]
src/player/hud.c:167:7: warning: variable ‘picnum’ set but not used [-Wunused-but-set-variable]
2021-01-26 20:24:31 +02:00
Daniel Gibson
7275a593a6 Fix architecture detection on Windows in Makefile, bump SAVEGAMEVER
.. and use YQ2ARCH and YQ2OSTYPE instead of just ARCH and OSTYPE
for the defines, so it's consistent with the engine and xatrix+rogue.

$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-4" and added a quirk for older savegameversions:
On Windows i386 savegames that contain "AMD64" instead of "i386" as
architecture are also accepted.
(For YQ2-1 this didn't seem necessary, apparently "i386" was hardcoded)
2021-01-14 03:53:47 +01:00
Yamagi
40fb2366d1
Merge pull request #14 from Soldy/master
error during compiling the code #13
2020-06-02 08:47:38 +02:00
Soldy
06b54182b7 error during compiling the code #13
Signed-off-by: Soldy <4786022+Soldy@users.noreply.github.com>
2020-05-30 18:22:15 +01:00
Yamagi
6276ba483f
Merge pull request #12 from mjr4077au/Client_AimFixWithCVAR
Implement accurate-aiming CVAR in zaero game code.
2020-04-21 12:48:45 +02:00
Yamagi
a047746337
Merge pull request #11 from NeonKnightOA/cppcheckfixes
Fixed many issues pointed out by cppcheck.
2020-04-21 12:48:32 +02:00
Mitchell Richters
82240af227 Implement accurate-aiming CVAR in zaero game code. 2020-04-21 08:02:29 +10:00
NeonKnightOA
3b53b244e6 Fixed: Function 'LerpAngle' argument order different: declaration 'a1, a2, frac' definition 'a2, a1, frac' 2020-02-04 12:48:33 -03:00
NeonKnightOA
3369a24f77 Fixed many issues pointed out by cppcheck.
Fixed the following issues found by cppcheck:

```
[src\g_func.c:576] (warning) Either the condition 'if(other)' is redundant or there is possible null pointer dereference: other. [nullPointerRedundantCheck]

[src\g_func.c:1500] (warning) Either the condition 'if(other)' is redundant or there is possible null pointer dereference: other. [nullPointerRedundantCheck]

[src\g_func.c:1931] (warning) Either the condition 'if(other)' is redundant or there is possible null pointer dereference: other. [nullPointerRedundantCheck]

[src\g_func.c:2623] (warning) Either the condition 'if(other)' is redundant or there is possible null pointer dereference: other. [nullPointerRedundantCheck]

[src\g_misc.c:156] (warning) Identical condition '!self', second condition is always false [identicalConditionAfterEarlyExit]

[src\g_misc.c:337] (warning) Identical condition '!self', second condition is always false [identicalConditionAfterEarlyExit]

[src\g_phys.c:1109] (warning) Either the condition '!ent' is redundant or there is possible null pointer dereference: ent. [nullPointerRedundantCheck]

[src\g_spawn.c:372] (style) Defensive programming: The variable 'i' is used as an array index before it is checked that is within limits. This can mean that the array might be accessed out of bounds. Reorder conditions such as '(a[i] && i < 10)' to '(i < 10 && a[i])'. That way the array will not be accessed if the index is out of limits. [arrayIndexThenCheck]

[src\g_spawn.c:309] (warning) Identical condition '!ent', second condition is always false [identicalConditionAfterEarlyExit]

[src\g_utils.c:30] (warning) Identical condition '!from', second condition is always false [identicalConditionAfterEarlyExit]

[src\g_utils.c:69] (warning) Identical condition '!from', second condition is always false [identicalConditionAfterEarlyExit]

[src\monster\boss\boss.c:420] (warning) Either the condition '!self' is redundant or there is possible null pointer dereference: self. [nullPointerRedundantCheck]

[src\monster\boss\boss.c:749] (warning) Either the condition '!self' is redundant or there is possible null pointer dereference: self. [nullPointerRedundantCheck]

[src\monster\boss\boss.c:1032] (warning) Either the condition '!ent' is redundant or there is possible null pointer dereference: ent. [nullPointerRedundantCheck]

[src\monster\misc\move.c:437] (style) Condition '!enemy' is always false [knownConditionTrueFalse]

[src\player\client.c:529] (style) Condition 'attacker' is always true [knownConditionTrueFalse]

[src\player\client.c:529] (style) Condition 'inflictor' is always true [knownConditionTrueFalse]

[src\player\view.c:893] (warning) Either the condition '!ent' is redundant or there is possible null pointer dereference: ent. [nullPointerRedundantCheck]

[src\shared\shared.c:1160] (warning) Opposite inner 'if' condition leads to a dead code block (outer condition is '*s' and inner condition is '!*s'). [oppositeInnerCondition]

[src\shared\shared.c:1225] (warning) Opposite inner 'if' condition leads to a dead code block (outer condition is '*s' and inner condition is '!*s'). [oppositeInnerCondition]

[src\shared\shared.c:1303] (warning) Either the condition '!value' is redundant or there is possible null pointer dereference: value. [nullPointerRedundantCheck]

[src\zaero\acannon.c:431] (warning) Either the condition '!self' is redundant or there is possible null pointer dereference: self. [nullPointerRedundantCheck]

[src\zaero\ai.c:107] (warning) Either the condition '!self' is redundant or there is possible null pointer dereference: self. [nullPointerRedundantCheck]
```

Only these two are missing, I haven't figured out what should I do:
```
[src\monster\misc\move.c:650] (style) Condition 'rand()&(7==1)' is always false [knownConditionTrueFalse]

[src\zaero\mtest.c:506] (error) Resource leak: wCfgFile [resourceLeak]
```
2020-02-04 12:27:41 -03:00
Yamagi
c49cb3982d
Merge pull request #9 from NeonKnightOA/pvsfixes
Adding struct checks to files. This solves countless of issues and bugs.
2020-02-04 09:27:34 +01:00
NeonKnightOA
dae4e2c537 Adding struct checks to files. This solves countless of issues and bugs. 2020-02-03 12:51:22 -03:00
Yamagi
8236760dfd
Merge pull request #8 from NeonKnightOA/skills
Easier handling of skill levels by using defines instead of numbers
2020-01-30 18:36:21 +01:00
NeonKnightOA
72c6681746 Oops... forgot the header. Sorry! 2020-01-29 14:14:27 -03:00
NeonKnightOA
afc3c22b84 Easier handling of skill levels by using defines instead of numbers 2020-01-22 13:42:15 -03:00
Yamagi
efc0e1b1fe
Merge pull request #5 from Pickle/master
Added cmake support
2019-05-09 18:36:44 +02:00
Yamagi Burmeister
47010478bc Fix missmerge, ReadField() may only be called once for each field. 2019-02-05 09:10:31 +01:00
Yamagi Burmeister
511db03dfc Fix clang warnings, abs() may not be used for floats. 2019-02-04 13:31:11 +01:00
Yamagi Burmeister
7bb26be80c Port compiler detection from the other addons.
This is done to keep the Makefiles more or less in sync.
2019-02-04 13:29:44 +01:00
Yamagi Burmeister
4bdd8facd5 Merge outstanding savegame changes from yquake.
- Switch from an whitelist base approach regarding platforms and systems
  to an blacklist approach. This is savegame version 2.
- Fix coop_respan struct not fully initialized after savegame load while
  running in coop mode. This is savegame version 3.

Support for savegame version 2 was added to keep the divergence between
zaero and the other addons low.
2019-02-04 13:24:13 +01:00
Scott
0126a7f93a Added cmake support 2018-12-15 16:29:25 -05:00
Daniel Gibson
4e031fe308 Switch to Enforcers bloody skin when he's killed
When killing the enforcer with one shot (instead of damaging him first
without killing, which will switch to the bloody skin), the skin wasn't
changed. Now it is.
2018-10-03 17:49:07 +02:00
Daniel Gibson
61b100d096 Fix Windows build 2016-02-20 20:42:20 +01:00
Daniel Gibson
ac084046a8 Fix Windows detection in makefile for MinGW 2016-02-20 20:34:31 +01:00
Daniel Gibson
b0f4627044 coop spawnpoint fix from other addons 2016-02-20 20:29:38 +01:00
Daniel Gibson
2bcbd86a61 A few fixes from q2dos 2016-02-20 18:20:20 +01:00
Daniel Gibson
3fabd3c09c remove (unused) q_shared.h
header/shared.h is used instead
2016-02-20 18:19:57 +01:00
Daniel Gibson
469c53e03e Reset gibsthisframe and lastgibframe at map change
ported de5849caf534c5c687bcfcd9f5951e3a62da3fd7 from yquake2 to zaero
2016-02-20 17:46:14 +01:00
Daniel Gibson
0822b94db9 Fixed some crashes during gameplay and loading; broke savegame compat
I added more missing fields to savegame/tables/fields.h and reordered
everything to make missing fields easier to find.
This broke savegame compatibility, and that might happen again.
I hope I'll remember to bump the savegame version before merging this
branch to master.

I also got segfaults (e.g. when a door was blocked by a corpse) in
G_UseTargets() because activator was NULL.

And in g_cmds.c there was a typo in OnSameTeam() - from the relatively
recent fix. No idea why, it doesn't exist in the other addons..
2015-06-29 18:11:12 +02:00
Daniel Gibson
0e4e1b7285 Fix crashes when loading savegame
savegame/tables/fields.h was missing some fields with FFL_NOSPAWN
and FFL_NOSPAWN handling in g_spawn.c was missing

Because of that after loading a savegame some pointers were invalid
and dereferencing them resulted in segfaults.
2015-05-19 04:19:41 +02:00
Daniel Gibson
aa5ccc1770 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:48:21 +02:00
Daniel Gibson
398aeff770 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 18:06:36 +01:00
Lennart Burmeister
3bcb10d734 Windows and OS X support for the Makefile 2013-05-13 08:12:00 +02:00
Yamagi Burmeister
7e05ae8f6e At some more informations to the README
This is a port of Team Evolves Zaero to Yamagi Quake II. It's
unfinished. While it might work, there are most likely some serious bugs
left! Use this at you own risk! Patches (or better pull requests) are
welcome.

The first commit messages are a mess and in german. Sorry for that.
2012-04-29 11:31:52 +02:00
Yamagi Burmeister
49f92a0c72 Correctly destroy blocking entities and derefernce entities destroyed by
the killbox
2011-10-12 07:50:52 +00:00
Yamagi Burmeister
9d1d32d2be Add savegames tables, missed yesterday 2011-10-12 07:10:17 +00:00
Yamagi Burmeister
8770845581 Fix non-moving soldiers 2011-10-11 15:41:08 +00:00
Yamagi Burmeister
be4833ab5f Add README 2011-10-11 15:31:02 +00:00
Yamagi Burmeister
04163afa82 Rearrange files 2011-10-11 15:28:06 +00:00
Yamagi Burmeister
6d456db7d1 Port the new savegame system 2011-10-11 14:28:49 +00:00
Yamagi Burmeister
59bfb6f8c4 Calculate a real bounding box for rotating entities 2011-10-11 14:15:32 +00:00
Yamagi Burmeister
71d6ee0935 Fix the crash when too much debris or gibs is shown 2011-10-11 14:13:17 +00:00
Yamagi Burmeister
b49bec2143 Remove static 2011-10-11 10:12:01 +00:00
Yamagi Burmeister
6cddf17b88 Add LICENSE files 2011-10-10 19:40:18 +00:00
Yamagi Burmeister
3e9cdcd3b3 Resurrect zaero. 2011-10-10 19:26:35 +00:00
Yamagi Burmeister
179cd6b1d0 Fixt einen Crash beim Benutzen der lasergranaten 2009-10-08 15:56:19 +00:00
Yamagi Burmeister
4a9bfc2cf3 Weapon, Trigger, Sentien und Spwan aufgeräumt 2009-10-08 15:37:19 +00:00
Yamagi Burmeister
3492d05a57 Hund, Items, Handler, Kamera und MTest aufgeräumt 2009-10-08 15:14:40 +00:00