mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-29 15:22:29 +00:00
SERVER: Fix Electric Barrier bounding box when pointed upwards
This commit is contained in:
parent
ddc845f447
commit
901ee7121e
1 changed files with 7 additions and 2 deletions
|
@ -294,13 +294,17 @@ void() zapper_switch =
|
||||||
|
|
||||||
void() set_zapper_bbox =
|
void() set_zapper_bbox =
|
||||||
{
|
{
|
||||||
|
vector bbmin, bbmax;
|
||||||
// Retrieve the distance between this zapper and the one
|
// Retrieve the distance between this zapper and the one
|
||||||
// it's linked to.
|
// it's linked to.
|
||||||
entity other_zapper = find(world, targetname, self.target);
|
entity other_zapper = find(world, targetname, self.target);
|
||||||
float distance = abs(vlen(other_zapper.origin - self.origin));
|
float distance = abs(vlen(other_zapper.origin - self.origin));
|
||||||
|
|
||||||
vector bbmin = '0 0 0';
|
// Point upward by default
|
||||||
vector bbmax = '0 0 0';
|
bbmin = '-20 -20 -4';
|
||||||
|
bbmax_x = 20;
|
||||||
|
bbmax_y = 20;
|
||||||
|
bbmax_z = distance/2;
|
||||||
|
|
||||||
// X Axis
|
// X Axis
|
||||||
if (self.angles_x) {
|
if (self.angles_x) {
|
||||||
|
@ -399,6 +403,7 @@ void() zapper_node =
|
||||||
setorigin(self, self.origin);
|
setorigin(self, self.origin);
|
||||||
setmodel(self, self.model);
|
setmodel(self, self.model);
|
||||||
makevectors(self.angles);
|
makevectors(self.angles);
|
||||||
|
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||||
|
|
||||||
self.movetype = MOVETYPE_NONE;
|
self.movetype = MOVETYPE_NONE;
|
||||||
self.think = set_zapper_bbox;
|
self.think = set_zapper_bbox;
|
||||||
|
|
Loading…
Reference in a new issue