Commit graph

306 commits

Author SHA1 Message Date
BjossiAlfreds
7d29eff3bd Merge branch 'master' into makron 2019-09-26 14:01:56 +00:00
BjossiAlfreds
c03c6d4829 Fixed entities mysteriously teleporting to another location 2019-09-26 13:24:02 +00:00
BjossiAlfreds
f7e9b2c150 Makron torso flashes red like the legs 2019-09-26 12:42:57 +00:00
Yamagi
4c8c98731d
Merge pull request #32 from BjossiAlfreds/checkattack
Fixed monsters not changing state when enemy goes away
2019-09-26 14:24:04 +02:00
BjossiAlfreds
f76ce1d64b Fixed medics unable to heal makrons 2019-09-26 12:23:57 +00:00
BjossiAlfreds
0e177c90ea Investigated PVS report for player and shared and addressed the issues 2019-09-25 20:47:12 +00:00
BjossiAlfreds
55cfb537a3 Fixed monsters not changing state when enemy goes away 2019-09-25 20:14:52 +00:00
BjossiAlfreds
c2188ed5f6 Investigated PVS report for monster code and addressed a number of issues 2019-09-25 19:01:47 +00:00
BjossiAlfreds
e2cadbc06b Investigated PVS report for dm and addressed its points 2019-09-24 18:12:23 +00:00
BjossiAlfreds
4a429e7e57 Investigated PVS report for g_weapon and addressed its points 2019-09-24 18:05:59 +00:00
BjossiAlfreds
d72d5ba9e8 Investigated PVS report for g_utils and removed dead if-block 2019-09-23 22:18:29 +00:00
BjossiAlfreds
03800dfcd5 Investigated PVS report for g_turret and fixed uninitialized variable access 2019-09-23 22:15:01 +00:00
BjossiAlfreds
32419b8d3f Investigated PVS report for g_target and simplified the activator checking 2019-09-23 21:48:23 +00:00
BjossiAlfreds
5cd2216daa Investigated PVS report for svcmds and did not address type-punning code 2019-09-23 21:45:50 +00:00
BjossiAlfreds
a28f567c2c Investigated PVS report for g_sphere and addressed the issues 2019-09-23 21:08:38 +00:00
BjossiAlfreds
b914e8baf4 Investigated PVS report for newweap and addressed the issues 2019-09-23 20:59:06 +00:00
BjossiAlfreds
81c2f61d51 Investigated PVS reports for newai and newtarg and fixed issues 2019-09-23 20:38:56 +00:00
BjossiAlfreds
9b092af8e9 Investigated PVS report for g_misc and addressed the issues 2019-09-23 20:31:03 +00:00
BjossiAlfreds
c905e7ef1d Investigated PVS report for g_items and addressed 2 issues 2019-09-23 19:59:23 +00:00
BjossiAlfreds
e8637c02c6 Investigated PVS report for g_func and addressed the issues 2019-09-23 19:56:10 +00:00
BjossiAlfreds
e24d0cfd46 Investigated PVS report for g_combat and eliminated the unnecessary sub-expressions 2019-09-23 19:48:41 +00:00
BjossiAlfreds
b7f6d9da91 Investigated PVS report for g_cmds and use snprintf instead of sprintf 2019-09-23 19:44:35 +00:00
BjossiAlfreds
81e59effff Investigated PVS report for g_ai and addressed the issues 2019-09-23 19:41:02 +00:00
BjossiAlfreds
2eaf15ccf0 Merge remote-tracking branch 'upstream/master' into spawnflags 2019-09-23 16:42:09 +00:00
BjossiAlfreds
9642eec016 coop_baseq2 added and fully functional 2019-09-23 16:41:29 +00:00
Yamagi Burmeister
59cc08fd96 Fix floater melee / zap damage getting applied if enemy is out of range.
Found by @BjossiAlfreds, closes yquake2/yquake2#454.
2019-09-23 17:30:57 +02:00
Yamagi
f3dd878809
Merge pull request #30 from BjossiAlfreds/pathcorner
Fixed triggered spawn monsters not using path_corner markers
2019-09-23 14:07:47 +02:00
Yamagi
3bf86f4d61
Merge pull request #28 from BjossiAlfreds/etf-dmflags
Etf dmflags
2019-09-23 13:09:29 +02:00
BjossiAlfreds
29d0b6cbd5 Fixed triggered spawn monsters not using path_corner markers 2019-09-21 19:48:03 +00:00
BjossiAlfreds
fbbe82d543 Quick code style fix 2019-09-19 23:52:06 +00:00
BjossiAlfreds
66da1722ca ETF Rifle respects infinite ammo DM flag 2019-09-19 23:36:29 +00:00
BjossiAlfreds
8cb29103e2 maxvelocity correctly enforced 2019-09-19 23:17:42 +00:00
BjossiAlfreds
c79de3adfa Fix for insane marines pain sounds 2019-09-15 13:52:26 +00:00
Yamagi Burmeister
d289d0f302 Fix medic commander playing the wrong sound when retracting it's hook.
There's a sound commander_sound_hook_retract, it even get's precached,
but it wasn't refrerenced. Analysed and fix suggested by @BjossiAlfreds.
Closes #21.
2019-09-15 09:29:48 +02:00
Yamagi
120e4684d1
Merge pull request #24 from BjossiAlfreds/usetargets-crash-fix
Killtarget teamchain cleanup crash fix
2019-09-15 09:28:04 +02:00
BjossiAlfreds
fa063e9710 Killtarget teamchain cleanup crash fix 2019-09-14 11:59:06 +00:00
BjossiAlfreds
baf90e941c Rogue bugfix for monsters not fighting back against parasites 2019-09-14 08:12:33 +00:00
Yamagi Burmeister
325910d2fe Make sure that the entity to printes is valid.
Especially after savegame load not all slots in the edicts array may be
used. Check if the current entity has a classname string. This is
another part of yquake2/yquake2#430.
2019-09-07 14:26:42 +02:00
Yamagi Burmeister
e4daf3c070 Fix current health being reset to 100 if >100 at level change.
This is another code inconsistency, we must not clamp the current health
to the client max health (which apparently is always 100) but to the
current max health of the player entity.

Analyzed and fix suggest by @BjossiAlfreds, fixes yquake2/yquake2#441.
2019-09-06 07:17:14 +02:00
Yamagi Burmeister
119b9369e8 Fix monsters not fighting back when attacked by parasite or fixbot.
This is another corner case. Parasites and fixbots have a bbox height of
24, walkmonster_start_go() hardcodes a viewheight of 25. Therefor most
traces in other functions like visible() overshoot the parasite.  Fix
this by not overriding the monster viewheight.

Analyzed and fix suggested by @BjossiAlfreds. Closes issue
yquake2/yquake2#440.
2019-09-06 06:58:35 +02:00
Yamagi Burmeister
57df678fb6 Add 'listentities' command.
This rather sophisticated command prints all entities of one or more
given classes and their coordinates. Possible classes are:

* ammo
* items
* keys
* monsters
* weapons

Classes can be combined into one command, e.g. `listentities ammo keys'
would print all ammunition and all keys. The special class `all` prints
all entities, regardless of their class.

The command is protected by `cheats 1`.

This is part of issue yquake2/yquake2#430.
2019-09-05 17:45:31 +02:00
Yamagi Burmeister
d376d0e5ec Add a new command 'teleport'.
A command that teleports the player to abitrary locations was often
requested and may be helpfull for debugging, so finally add it. It works
like a normal teleporter: It moves the player to the requested location,
clears all movements, tells the server and clients that the entity just
teleported and telefrags everything that's in the target location.

The implementation does not verify if the requested location is save,
the player may teleport into the world model or even the void. But the
requested Z coordinate is elevated by 10 units to prevent the player
getting stuck in the floor.

The command is protected by sv_cheats.

This is part of issue yquake2/yquake2#430.
2019-09-05 16:51:53 +02:00
Yamagi Burmeister
501ed1e71a Try to fix monsters getting stuck by waiting forever for their enemy.
44472722e added some sanity checks to the AI code. The checks in
ai_run() are likely wrong because the enemy entity might be already
NULL if we arrive their. By aborting early the code is unable to
determine a new enemy or return the monster to idle state, so the
monster will wait forever for an enemy that'll never come.

This happens only in monster vs. monster fights. Never in monster vs.
player, that game ends if the player dies.

In theory this change should be harmless, because if the enemy entity is
gone it won't generate sound targets now be visible. If the game crashes
by self->enemy being NULL we've got a problem elsewere.

This was reported by @BjossiAlfreds in #483. He also suggested the fix
2019-08-31 11:11:04 +02:00
Yamagi Burmeister
003a1282ad Fix monsters being unable to see the player if he generates noise.
When searching for the player FinTarget() always goes after sound
targets and aborts as soon as it finds one. So if the player is
constantly generating sounds - for example firing the machine gun -
there's a high chance that monsters will only hear but never see
him. Work around this by adding a small timeout to player noises, make
sure that at least 3 frames passed since the last noise. This gives
monsters 2 frames to see the player.

This bug was present in the original code, this is a small gameplay
change.

The problem was analysed by @BjossiAlfreds in #436. He also suggested
the fix.
2019-08-31 11:10:04 +02:00
Yamagi Burmeister
8be3688b1a Fix berserker fidget animation aborting attack.
M_MoveFrame() calls first the AI functions that decide if a monster
should attack or not. After that the monsters think function is called
which walks through berserk_frames_stand[]. Even if the AI function found
an enemy and decided to attack, the monster is still standing for this
frame and berserker_fidget() is called. It may override the earlier
earlier decision, aborting the attack. Even worse this may let the
berserker stuck, because AI_STAND_GROUND may be cleared which prevents
further attacks.

This bug was present in the original code, so this is small gameplay
change. It's likely also present in both addons.

Reported and analyzed by @BjossiAlfreds in issue #433. He also suggested
the fix.
2019-08-31 11:08:44 +02:00
Yamagi Burmeister
ffb5bb57f8 Push entitie slightly away from non horizontal surfaces.
Otherwise the entities origin might be in the surface, which causes it
to be rendered in full black.
2019-06-15 17:45:50 +02:00
Yamagi Burmeister
9989340968 Add back the disruptor / desintegrator.
Make the disruptor and it's ammo available by 'give disruptor' and 'give
rounds'. If g_disruptor is set 0 (the defaults) neither the weapon, nor
the ammo is spawned in, if set to 1 it behaves like a normal weapon.
Based upon an idea by @NeonKnightOA submitted in PR #18.

This was requested in issue #17.
2019-06-11 14:07:48 +02:00
Daniel Gibson
000da6a653 Parasite doesn't leech through walls anymore
The problem was that its head was too close to/in the wall, so the trace
towards the player (to decide if he's reachable) started *in* the wall,
so the wall itself wasn't hit/detected.
Now the trace start is 8 units behind the head and it seems to work.

Fixes #9
2019-05-11 19:44:59 +02:00
Yamagi Burmeister
cf6bf166ff Fix missing sanity check, self->enemy can be null.
Suggested by @maraakate, closes #7.
2019-05-09 18:33:23 +02:00
Yamagi Burmeister
47520a0020 Don't allow 'give health 0' or even less.
Giving the player < -1 health and increasing it to something above 0
without closing the console breaks the player state.
2019-04-27 19:19:03 +02:00
Yamagi Burmeister
eaaf6c43d4 Fix a missmerge, save_ver is supported since version 4 and not 3. 2019-02-05 09:05:18 +01:00
Yamagi Burmeister
063776d504 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 10:50:23 +01:00
Yamagi Burmeister
1f82ad2154 Fix parasite, return true instead of false when checking attacks.
This was one of those stupid brainos where you know it better and still
do it wrong... In standard C the return value of a non-void function is
undefined if the closing } is reached. MSVC++5 and 6 returned 1 for
functions with return type int. Since qboolean == int parasite_blocked()
and parasite_checkattack() should return true and not false.

BUT: The true in parasite_blocked() was correct, in the original MSVC++6
build parasites always thought that they're blocked and tried to free
themself.

In parasite_checkattack() the false was wrong, so change it to true. And
yes, the function is crap. The better part of it doesn't make sense and
just burns CPU cycles for nothing. But it's working now and everyone is
happy, so let's leave it alone.

This fixes yquake2 issue #359.
2019-01-30 18:32:17 +01:00
Yamagi Burmeister
433a1423d9 Import Q_strlcpy() and replace several dangerous strncpy() with it. 2018-10-25 19:26:17 +02:00
Yamagi Burmeister
fbf3841eaa Call strcasecmp() and not Quake IIs home made version.
The home made version is crap and not const correct.
2018-10-25 19:22:27 +02:00
Yamagi Burmeister
ffdd699ff4 Add variable declaration missed in the last commit. 2018-10-13 09:08:31 +02:00
Yamagi Burmeister
ed4e94510d Split the gibs per frame limit between gibs and debris.
The gibs and debris per frame must be limited to prevent server mem
map overflows. Until now debris and gibs were handled the same, the
debris spawned by rockets and grenates could prevent the actual gibs
of the killed monster from spawning.

Before this change 20 entities were spawned at max. Now up tp 40
enties can be spawned. This needs some testings.
2018-10-07 12:03:23 +02:00
Yamagi Burmeister
c620cea34b Don't accelerate upper entities, let them be pushed by the lower ent.
A long time ago in 2b4f223 I introduced a small logic change to the
handling of stacked entities. If two entities were standing on each
other the original code set the movement speed of the upper entity
to 0. It would be pushed or dragged by the lower entity. I changed
that in way that the upper entity got the same speed as the lower
entity. With that change it wasn't pushed or dragged but moving on
it's own. I hoped to fix some of the 'elevator hurts player or monster'
bugs.

That hope was wrong, at a later time we quirked all elevators that hurt
the player. Additionally the change lead to physics bugs if entities are
standing on high speed elevators (more than 200 units per seconds). So
revert it
2018-10-07 11:58:46 +02:00
Daniel Gibson
82d8b31d02 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:45:47 +02:00
Yamagi Burmeister
0cfb74223e Replace strcasecmp() by Q_strcasecmp() for better MSVC compaibility.
This was suggest by @ajbonner in xatrix issue #11.
2018-03-23 15:52:08 +01:00
Yamagi Burmeister
02942e9544 Fix a potential crash in ai_run_melee() and ai_run_missile().
This was found and fixed by Maraakate.
2017-09-07 18:11:10 +02:00
Yamagi Burmeister
1776ec3d31 Fix monsters getting stuck when resurrected by a medic.
While in baseq2 monsters had the abillity to duck it wasn't used
often. The same goes for medics, there are only a few throughout the
whole single player campaign. In rogue things are differed. Due to
some AI changes like support for dodging monsters duck more often and
there a a lot of medics and even it's improved version, the medic
commander.

When a monster dies it's mmove_t is set to the death animation and
it's AI flags are left as they are. When a monster is resurrected by
a medic, the AI flags are reset to 0 and it's spawn function is
called again. Normally this is totally save. But when there're two
medics and both try to resurrect there monster there's a small window
for the monster being respawned without the AI flags reset.

In this case the mmove_t is set to the monsters standard animation,
while the AI flags may be still contain AI_DUCK. When AI_DUCK is set,
but the current animation is not one of the duck animations, the
monster may get stuck. There's even a comment in the code for that
case. ;) Solve this problem by resetting AI_DUCK as soon as the
monster dies.

With this change applied I was unable to reproduce any problem in
regard to medics, medic commanders, resurrection and spwaning of new
monsters.

This closes issue #6.
2017-01-20 16:32:00 +01:00
Yamagi Burmeister
7720887274 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:23:32 +01:00
Yamagi Burmeister
ff4c00e5e6 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:18:32 +01:00
Yamagi Burmeister
1c70fd8840 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:23:04 +01:00
Yamagi Burmeister
88617fac09 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:22:02 +01:00
Yamagi Burmeister
a389a36844 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:21:17 +01:00
Yamagi Burmeister
eba36895bb Remove another unneeded sanity checks.
This fixes a warning generated by Clang 3.9.
2016-12-17 10:52:14 +01:00
Yamagi Burmeister
d294e86a45 Remove an unnecessary check.
This was found by Clangs code analyzer.
2016-12-17 10:49:52 +01:00
Yamagi Burmeister
b58a3ae131 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 10:44:56 +01:00
Yamagi Burmeister
fbf505834f Use matching strtof(9 instead of atof().
This saves one cast. This was reported by maraakate in yquake2 issue
160.
2016-12-17 10:44:56 +01:00
Yamagi Burmeister
b16293c01b 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 10:44:56 +01:00
Yamagi Burmeister
89d48af99d 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 10:44:56 +01:00
Yamagi Burmeister
f893d5f8d0 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 10:44:56 +01:00
Yamagi Burmeister
f4002456b4 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 10:44:56 +01:00
Yamagi Burmeister
c61bff46d7 Don't leak unknown entities.
I don't think that this has a visible effect, because there shouldn't be
any unknown entities in maps creates with the official entities.def.
This was reported by maraakate in quake2 issue #160.
2016-12-17 10:44:56 +01:00
Yamagi Burmeister
63c71b4e4f Remove sanity check to *data in ED_ParseEdict().
There's another check down below. This was reported by maraakate in
yquake2 issue #160.
2016-12-17 10:44:56 +01:00
Yamagi Burmeister
75ea8fe63c Send the player entity to the server when in intermission.
I don't think that this has any visible effect, but it's saver than
assume that in multiplayer all clients enter the intermission at the
same time. This was reported by maraakate in yquake2 issue #160.
2016-12-17 10:44:56 +01:00
Yamagi Burmeister
2820da8267 Fix sanity check of door_secret_move6() and door_secret_die().
After this change they match the sanity checks in baseq2 and xatrix.
This was reported by maraakate in yquake2 issue #160.
2016-12-17 10:44:56 +01:00
Yamagi Burmeister
78de36c25a Fix sanity checks of train_blocked() and train_use()
With the changes the sanity checks are the same as in baseq2 and
xatrix. Reported by maraakate in yquake2 issue #160.
2016-12-17 10:44:56 +01:00
Yamagi Burmeister
d5fbc8c0f1 In Move_Calc() and AngleMove_Calc() add a sanity check to *func.
This is the same as in baseq2 and xatrix. This was reported by maraakate
in yquake2 issue #160.
2016-12-17 10:44:21 +01:00
Yamagi Burmeister
23cbffbd39 Set self->targetname to NULL when the head is thrown off
This should be a noop, since heads are only removed when an entity is
dying or dead. Noticed by maraakate and part of yquake2 issue #160.
2016-12-17 10:43:46 +01:00
Daniel Gibson
6f45072c26 Make debris SOLID_NOT
in baseq2 this caused bug #154
2016-10-24 17:28:32 +02:00
Daniel Gibson
08404e0949 Apply fix from 2009 for ai_run() and ai_checkattack(), but w/o old bug
To fix some bug, in baseq2 and xatrix
if(coop->value)
{
	if(FindTargeget(self))
	{
		return;
	}
}
was moved from ai_run() to ai_checkattack().
Do the same here, but without the bug from yquake2/#151
2016-10-23 18:27:31 +02:00
Yamagi Burmeister
6467137619 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:47:05 +02:00
Yamagi Burmeister
7e7ed6bf94 Make gibs and debris SOLID_BBOX so they move on entities. 2016-04-29 17:44:52 +02:00
Yamagi Burmeister
89cb707444 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:19:12 +02:00
Yamagi Burmeister
ac864530cd fix a divinely dumbassed mistake of global 'i' and 'corners' variables
Info_RemoveKey: use memmove instead of strcpy for overlapping memory
areas.

Submitted by: Ozkan Sezer
2015-08-31 18:39:25 +02:00
Yamagi Burmeister
a32778260f SV_Physics_Pusher: fix the 'memory corrupted' check
Submitted by: Ozkan Sezer
2015-08-31 18:36:54 +02:00
Yamagi Burmeister
be3472d045 fix several printf format string errors in games' code
Submitted by: Ozkan Sezer
2015-08-31 18:36:18 +02:00
Yamagi Burmeister
40183c82ae fix misplaced braces in the last else case
Submitted by: Ozkan Sezer
2015-08-31 18:33:50 +02:00
Yamagi Burmeister
a2c0f5cb4f Remove unused prototype of GetGameAPI()
Submitted by: Ozkan Sezer
2015-08-31 18:32:43 +02:00
Daniel Gibson
7929e845d3 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:40:49 +02:00
Daniel Gibson
bcbae17d9c Fix Coop Bug in RHANGAR1 when friendly fire was off
In 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.

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:50:34 +01:00
Yamagi Burmeister
6c854253de Remove unnecessary conditionals. They're always true. 2014-08-03 11:40:36 +02:00
Yamagi Burmeister
1859c42484 Use correct return type 2014-08-03 11:34:06 +02:00
Yamagi Burmeister
d8eb7037a4 Use correct flavor of abs() 2014-08-03 11:29:47 +02:00
Yamagi Burmeister
8dd8520ddc 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:44:21 +02:00
Yamagi Burmeister
bac51c8d95 Whitespace cleanup 2014-02-22 13:20:22 +01:00
Yamagi Burmeister
926c38ac1b Fix help computer and inventory updates when already opened
These changes ware originally committed by svdijk into baseq2
as reveison 6f6c9a1 to 20110fa.
2014-02-22 13:14:02 +01:00
Yamagi Burmeister
f4058dc8e9 Remove to unsued variables not found by Clang 2014-02-13 08:10:06 +01:00
Yamagi Burmeister
e53422065e Add functions of Deadalus and Medic Commander
This brings the necessary changes to the savegame tables for being able
to save levels with an Deadalus or Medic Commander. Since this breaks
savegame compatiblity, bump the savegame version. *sigh*
2014-02-11 19:07:27 +01:00
Yamagi Burmeister
069ded5e88 Bring back the Medic Commander, lost during early cleanup 2014-02-11 19:07:07 +01:00
Yamagi Burmeister
2bbb79e56b Bring back the Deadalus, lost during early cleanup 2014-02-11 19:06:23 +01:00
Yamagi Burmeister
5fe56d8bac Fix manual loading of maps in coop mode
This change ports my magic "find the right coop spawnpoint if target is
unset"-heuristic from baseq2 to rogue. This code was originally written
by me and is licensed to the GPL and the Quake II SDK license. With this
change all maps can by loaded by console in coop mode without spawnpoint
problems.
2014-02-06 19:23:06 +01:00
Yamagi Burmeister
f69e6aa98a Cleanup window (both stages) and add sanity checks 2014-02-06 18:49:22 +01:00
Yamagi Burmeister
eb4dc2b586 Cleanup turret and add sanity checks 2014-02-06 18:46:12 +01:00
Yamagi Burmeister
342c157e15 Cleanup tank and add sanity checks 2014-02-06 18:45:56 +01:00
Yamagi Burmeister
e77291f8c7 Cleanup supertank and add sanity checks 2014-02-06 18:42:23 +01:00
Yamagi Burmeister
cb95ec45a0 Cleanup stalker and add sanity checks 2014-02-06 18:42:06 +01:00
Yamagi Burmeister
f10b7137ff Cleanup soldier and add sanity checks 2014-02-06 18:41:49 +01:00
Yamagi Burmeister
af65bf67e0 Cleanup parasite and add sanity checks 2014-02-05 19:46:50 +01:00
Yamagi Burmeister
8bf6b098b2 Cleanup mutant and add sanity checks 2014-02-05 19:46:32 +01:00
Yamagi Burmeister
ea8149e344 Cleanup player animations 2014-02-05 19:46:18 +01:00
Yamagi Burmeister
93b666e830 Cleanup move.c and add sanity checks 2014-02-05 19:45:59 +01:00
Yamagi Burmeister
817cb17c10 Cleanup medic and add sanity checks 2014-02-05 19:45:37 +01:00
Yamagi Burmeister
f13744b79e Cleanup insane and add sanity checks 2014-02-05 19:43:50 +01:00
Yamagi Burmeister
b123f6870d Cleanup infantry and add sanity checks 2014-02-05 19:43:26 +01:00
Yamagi Burmeister
cc4c996cd5 Cleanup hover and add sanity checks 2014-02-04 17:32:13 +01:00
Yamagi Burmeister
c9f4d792f9 Cleanup gunner and add sanity checks 2014-02-04 17:31:41 +01:00
Yamagi Burmeister
a3eb6b72aa Cleanup gladiator and add sanity checks 2014-02-04 17:31:19 +01:00
Yamagi Burmeister
08e453217d Cleanup flyer and add sanity checks 2014-02-04 17:29:42 +01:00
Yamagi Burmeister
73899ec20c Cleanup floater and add sanity checks 2014-02-04 17:29:21 +01:00
Yamagi Burmeister
e2edf54062 Cleanup flipper and add sanity checks 2014-02-04 17:29:01 +01:00
Yamagi Burmeister
d3710d28e1 Cleanup chick and add sanity checks 2014-02-03 17:51:47 +01:00
Yamagi Burmeister
9e61cdfc45 Cleanup carrier and add sanity checks 2014-02-03 17:51:27 +01:00
Yamagi Burmeister
21948786d0 Cleanup brain and add sanity checks 2014-02-03 17:50:12 +01:00
Yamagi Burmeister
a12497536f Cleanup boss3 and add sanity checks 2014-02-03 17:49:44 +01:00
Yamagi Burmeister
134d6008c1 Cleanupo boss2 and add sanity checks 2014-02-03 17:48:44 +01:00
Yamagi Burmeister
2c05b79e46 Cleanup berserker and add sanity checks 2014-02-03 17:48:26 +01:00
Yamagi Burmeister
d97357f177 Remove actor
The actor was a special "monster" used für simulating NPC. It was never
fully implemented and therefor disfunctional. Thus it was never used in
any map. Remove it like done in baseq2 and xatrix.
2014-02-02 18:40:34 +01:00
Yamagi Burmeister
83e9c55ab5 Cleanup local.h 2014-02-02 18:17:27 +01:00
Yamagi Burmeister
777e939e8c Cleanup game.h 2014-02-02 18:14:54 +01:00
Yamagi Burmeister
daefddcf6b Add file headers
With this commit the game logic is cleaned up. Coop spawnpoint cleanup
is still missing, it'll be done at a later time. While not completely
finshed, rogue should alread run much more stable than the unmodified
code. Please note, that this is still untested! Headers are next,
monsters will be done after that.
2014-01-30 18:33:36 +01:00
Yamagi Burmeister
3f70140b56 Cleanup tag.c and add sanity checks 2014-01-30 18:20:59 +01:00
Yamagi Burmeister
19ae368fef Cleanup ball.c and add sanity checks 2014-01-30 18:20:59 +01:00
Yamagi Burmeister
6bb515a5e3 Cleanup weapon.c and add sanity checks 2014-01-30 18:20:53 +01:00
Yamagi Burmeister
676f6c5f25 Cleanup view.c and add sanity checks 2014-01-30 18:20:53 +01:00
Yamagi Burmeister
91393ab581 Cleanup trail.c and add sanity checks 2014-01-30 18:20:53 +01:00
Yamagi Burmeister
174a7b42bc Cleanup hud.c and add sanity checks 2014-01-30 18:20:53 +01:00
Yamagi Burmeister
d8c6aae783 Cleanup client.c and add sanity checks 2014-01-30 18:20:53 +01:00
Yamagi Burmeister
79eb5c8c09 Cleanup g_weapon.c and add sanity checks 2014-01-30 18:20:53 +01:00
Yamagi Burmeister
dd6503a780 Cleanup g_utils.c and add sanity checks 2014-01-30 18:20:53 +01:00
Yamagi Burmeister
2f89dd8382 Cleanup g_turret.c and add sanity checks 2014-01-30 18:20:53 +01:00
Yamagi Burmeister
695d83441e Cleanup g_trigger.c and add sanity checks 2014-01-30 18:20:52 +01:00
Yamagi Burmeister
811e038971 Cleanup g_target.c and add sanity checks 2014-01-30 18:20:52 +01:00
Yamagi Burmeister
3be19fed3a Cleanup g_svcmds.c and add sanity checks 2014-01-30 18:20:52 +01:00
Yamagi Burmeister
a81e7e6bf7 Cleanup g_sphere.c and add sanity checks 2014-01-30 18:20:52 +01:00
Yamagi Burmeister
ef791c82c1 Cleanup src/g_spawn.c and add sanity checks 2014-01-30 18:20:52 +01:00
Yamagi Burmeister
b417093ec8 Cleanup g_phys.c and add sanity checks 2014-01-30 18:20:52 +01:00