mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-25 22:10:59 +00:00
game: sync ctf g_weapon
This commit is contained in:
parent
675ce35e75
commit
5c49886d7b
5 changed files with 45 additions and 1101 deletions
2
Makefile
2
Makefile
|
@ -1486,7 +1486,7 @@ CTF_OBJS_ = \
|
|||
src/ctf/g_target.o \
|
||||
src/ctf/g_trigger.o \
|
||||
src/ctf/g_utils.o \
|
||||
src/ctf/g_weapon.o \
|
||||
src/game/g_weapon.o \
|
||||
src/game/menu/menu.o \
|
||||
src/game/monster/misc/move.o \
|
||||
src/ctf/player/client.o \
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) ZeniMax Media Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -2748,6 +2749,28 @@ SP_item_health_mega(edict_t *self)
|
|||
self->style = HEALTH_IGNORE_MAX | HEALTH_TIMED;
|
||||
}
|
||||
|
||||
void
|
||||
SP_item_foodcube(edict_t *self)
|
||||
{
|
||||
if (!self)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH))
|
||||
{
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
}
|
||||
|
||||
self->model = "models/objects/trapfx/tris.md2";
|
||||
SpawnItem(self, FindItem("Health"));
|
||||
self->spawnflags |= DROPPED_ITEM;
|
||||
self->style = HEALTH_IGNORE_MAX;
|
||||
gi.soundindex("items/s_health.wav");
|
||||
self->classname = "foodcube";
|
||||
}
|
||||
|
||||
void
|
||||
InitItems(void)
|
||||
{
|
||||
|
|
|
@ -339,6 +339,19 @@ vec3_t MOVEDIR_UP = {0, 0, 1};
|
|||
vec3_t VEC_DOWN = {0, -2, 0};
|
||||
vec3_t MOVEDIR_DOWN = {0, 0, -1};
|
||||
|
||||
void
|
||||
get_normal_vector(const cplane_t *p, vec3_t normal)
|
||||
{
|
||||
if (p)
|
||||
{
|
||||
VectorCopy(p->normal, normal);
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy(vec3_origin, normal);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G_SetMovedir(vec3_t angles, vec3_t movedir)
|
||||
{
|
||||
|
|
1100
src/ctf/g_weapon.c
1100
src/ctf/g_weapon.c
File diff suppressed because it is too large
Load diff
|
@ -1170,6 +1170,14 @@ bfg_think(edict_t *self)
|
|||
continue;
|
||||
}
|
||||
|
||||
/* don't target players in CTF */
|
||||
if (ctf->value && ent->client &&
|
||||
self->owner->client &&
|
||||
(ent->client->resp.ctf_team == self->owner->client->resp.ctf_team))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
VectorMA(ent->absmin, 0.5, ent->size, point);
|
||||
|
||||
VectorSubtract(point, self->s.origin, dir);
|
||||
|
|
Loading…
Reference in a new issue