game: sync ctf g_weapon

This commit is contained in:
Denis Pauk 2023-10-24 17:22:44 +03:00
parent 675ce35e75
commit 5c49886d7b
5 changed files with 45 additions and 1101 deletions

View file

@ -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 \

View file

@ -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)
{

View file

@ -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)
{

File diff suppressed because it is too large Load diff

View file

@ -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);