mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-08 03:27:58 +03:00
Reversing Actor #1
This commit is contained in:
parent
d1b5d78bf0
commit
4b79fb2097
5 changed files with 995 additions and 194 deletions
|
@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
// actor_machinegunner.cpp
|
||||
|
||||
#include "actor.h"
|
||||
#include "weapturret.h"
|
||||
|
||||
void Actor::InitMachineGunner
|
||||
(
|
||||
|
@ -94,13 +95,33 @@ void Actor::FinishedAnimation_MachineGunner
|
|||
|
||||
bool Actor::MachineGunner_CanSee
|
||||
(
|
||||
Entity *e1,
|
||||
Entity *ent,
|
||||
float fov,
|
||||
float vision_distance
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
STUB();
|
||||
float delta[2];
|
||||
|
||||
delta[0] = ent->centroid[0] - centroid[0];
|
||||
delta[1] = ent->centroid[1] - centroid[1];
|
||||
if ((vision_distance <= 0.0f) || (delta[0] * delta[0] + delta[1] * delta[1]) <= (vision_distance * vision_distance))
|
||||
{
|
||||
if (gi.AreasConnected(edict->r.areanum, ent->edict->r.areanum) &&
|
||||
((fov <= 0.0f || fov >= 360.0f) ||
|
||||
(FovCheck(delta, cos(fov * (0.5 * M_PI / 180.0))))))
|
||||
{
|
||||
return G_SightTrace(centroid,
|
||||
vec_zero,
|
||||
vec_zero,
|
||||
ent->centroid,
|
||||
m_pTurret,
|
||||
ent,
|
||||
MASK_CANSEE,
|
||||
0,
|
||||
"Actor::MachineGunner_CanSee");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue