diff --git a/neo/doom3/game/ai/AI.h b/neo/doom3/game/ai/AI.h index 4bc295bd..8cb93a6c 100644 --- a/neo/doom3/game/ai/AI.h +++ b/neo/doom3/game/ai/AI.h @@ -2,9 +2,9 @@ =========================================================================== IceTech GPL Source Code -Copyright (C) 2026 Justin Marshall +Copyright (C) 2026 Justin Marshall -This file is part of the IceTech GPL Source Code (?IceTech Source Code?). +This file is part of the IceTech GPL Source Code (?IceTech Source Code?). IceTech Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,13 +37,13 @@ If you have questions concerning this license or the applicable additional terms =============================================================================== */ -const float SQUARE_ROOT_OF_2 = 1.414213562f; -const float AI_TURN_PREDICTION = 0.2f; -const float AI_TURN_SCALE = 60.0f; -const float AI_SEEK_PREDICTION = 0.3f; -const float AI_FLY_DAMPENING = 0.15f; -const float AI_HEARING_RANGE = 2048.0f; -const int DEFAULT_FLY_OFFSET = 68; +const float SQUARE_ROOT_OF_2 = 1.414213562f; +const float AI_TURN_PREDICTION = 0.2f; +const float AI_TURN_SCALE = 60.0f; +const float AI_SEEK_PREDICTION = 0.3f; +const float AI_FLY_DAMPENING = 0.15f; +const float AI_HEARING_RANGE = 2048.0f; +const int DEFAULT_FLY_OFFSET = 68; #define ATTACK_IGNORE 0 #define ATTACK_ON_DAMAGE 1 @@ -70,7 +70,7 @@ typedef enum { MOVE_TO_ENEMY = NUM_NONMOVING_COMMANDS, MOVE_TO_ENEMYHEIGHT, - MOVE_TO_ENTITY, + MOVE_TO_ENTITY, MOVE_OUT_OF_RANGE, MOVE_TO_ATTACK_POSITION, MOVE_TO_COVER, @@ -110,20 +110,20 @@ typedef enum { // obstacle avoidance typedef struct obstaclePath_s { idVec3 seekPos; // seek position avoiding obstacles - idEntity * firstObstacle; // if != NULL the first obstacle along the path + idEntity* firstObstacle; // if != NULL the first obstacle along the path idVec3 startPosOutsideObstacles; // start position outside obstacles - idEntity * startPosObstacle; // if != NULL the obstacle containing the start position + idEntity* startPosObstacle; // if != NULL the obstacle containing the start position idVec3 seekPosOutsideObstacles; // seek position outside obstacles - idEntity * seekPosObstacle; // if != NULL the obstacle containing the seek position + idEntity* seekPosObstacle; // if != NULL the obstacle containing the seek position } obstaclePath_t; // path prediction typedef enum { - SE_BLOCKED = BIT(0), - SE_ENTER_LEDGE_AREA = BIT(1), - SE_ENTER_OBSTACLE = BIT(2), - SE_FALL = BIT(3), - SE_LAND = BIT(4) + SE_BLOCKED = BIT(0), + SE_ENTER_LEDGE_AREA = BIT(1), + SE_ENTER_OBSTACLE = BIT(2), + SE_FALL = BIT(3), + SE_LAND = BIT(4) } stopEvent_t; typedef struct predictedPath_s { @@ -132,7 +132,7 @@ typedef struct predictedPath_s { idVec3 endNormal; // normal of blocking surface int endTime; // time predicted int endEvent; // event that stopped the prediction - const idEntity * blockingEntity; // entity that blocks the movement + const idEntity* blockingEntity; // entity that blocks the movement } predictedPath_t; // @@ -162,17 +162,17 @@ typedef struct particleEmitter_s { time = 0; joint = INVALID_JOINT; }; - const idDeclParticle *particle; + const idDeclParticle* particle; int time; jointHandle_t joint; } particleEmitter_t; class idMoveState { public: - idMoveState(); + idMoveState(); - void Save( idSaveGame *savefile ) const; - void Restore( idRestoreGame *savefile ); + void Save(idSaveGame* savefile) const; + void Restore(idRestoreGame* savefile); moveType_t moveType; moveCommand_t moveCommand; @@ -197,21 +197,21 @@ public: class idAASFindCover : public idAASCallback { public: - idAASFindCover( const idVec3 &hideFromPos ); - ~idAASFindCover(); + idAASFindCover(const idVec3& hideFromPos); + ~idAASFindCover(); - virtual bool TestArea( const idAAS *aas, int areaNum ); + virtual bool TestArea(const idAAS* aas, int areaNum); private: pvsHandle_t hidePVS; - int PVSAreas[ idEntity::MAX_PVS_AREAS ]; + int PVSAreas[idEntity::MAX_PVS_AREAS]; }; class idAASFindAreaOutOfRange : public idAASCallback { public: - idAASFindAreaOutOfRange( const idVec3 &targetPos, float maxDist ); + idAASFindAreaOutOfRange(const idVec3& targetPos, float maxDist); - virtual bool TestArea( const idAAS *aas, int areaNum ); + virtual bool TestArea(const idAAS* aas, int areaNum); private: idVec3 targetPos; @@ -220,59 +220,59 @@ private: class idAASFindAttackPosition : public idAASCallback { public: - idAASFindAttackPosition( const idAI *self, const idMat3 &gravityAxis, idEntity *target, const idVec3 &targetPos, const idVec3 &fireOffset ); - ~idAASFindAttackPosition(); + idAASFindAttackPosition(const idAI* self, const idMat3& gravityAxis, idEntity* target, const idVec3& targetPos, const idVec3& fireOffset); + ~idAASFindAttackPosition(); - virtual bool TestArea( const idAAS *aas, int areaNum ); + virtual bool TestArea(const idAAS* aas, int areaNum); private: - const idAI *self; - idEntity *target; + const idAI* self; + idEntity* target; idBounds excludeBounds; idVec3 targetPos; idVec3 fireOffset; idMat3 gravityAxis; pvsHandle_t targetPVS; - int PVSAreas[ idEntity::MAX_PVS_AREAS ]; + int PVSAreas[idEntity::MAX_PVS_AREAS]; }; class idAI : public idActor { public: - CLASS_PROTOTYPE( idAI ); + CLASS_PROTOTYPE(idAI); - idAI(); - ~idAI(); + idAI(); + ~idAI(); - void Save( idSaveGame *savefile ) const; - void Restore( idRestoreGame *savefile ); + void Save(idSaveGame* savefile) const; + void Restore(idRestoreGame* savefile); - void Spawn( void ); - void HeardSound( idEntity *ent, const char *action ); - idActor *GetEnemy( void ) const; - void TalkTo( idActor *actor ); - talkState_t GetTalkState( void ) const; + void Spawn(void); + void HeardSound(idEntity* ent, const char* action); + idActor* GetEnemy(void) const; + void TalkTo(idActor* actor); + talkState_t GetTalkState(void) const; - bool GetAimDir( const idVec3 &firePos, idEntity *aimAtEnt, const idEntity *ignore, idVec3 &aimDir ) const; + bool GetAimDir(const idVec3& firePos, idEntity* aimAtEnt, const idEntity* ignore, idVec3& aimDir) const; - void TouchedByFlashlight( idActor *flashlight_owner ); + void TouchedByFlashlight(idActor* flashlight_owner); - // Outputs a list of all monsters to the console. - static void List_f( const idCmdArgs &args ); + // Outputs a list of all monsters to the console. + static void List_f(const idCmdArgs& args); - // Finds a path around dynamic obstacles. - static bool FindPathAroundObstacles( const idPhysics *physics, const idAAS *aas, const idEntity *ignore, const idVec3 &startPos, const idVec3 &seekPos, obstaclePath_t &path ); - // Frees any nodes used for the dynamic obstacle avoidance. - static void FreeObstacleAvoidanceNodes( void ); - // Predicts movement, returns true if a stop event was triggered. - static bool PredictPath( const idEntity *ent, const idAAS *aas, const idVec3 &start, const idVec3 &velocity, int totalTime, int frameTime, int stopEvent, predictedPath_t &path ); - // Return true if the trajectory of the clip model is collision free. - static bool TestTrajectory( const idVec3 &start, const idVec3 &end, float zVel, float gravity, float time, float max_height, const idClipModel *clip, int clipmask, const idEntity *ignore, const idEntity *targetEntity, int drawtime ); - // Finds the best collision free trajectory for a clip model. - static bool PredictTrajectory( const idVec3 &firePos, const idVec3 &target, float projectileSpeed, const idVec3 &projGravity, const idClipModel *clip, int clipmask, float max_height, const idEntity *ignore, const idEntity *targetEntity, int drawtime, idVec3 &aimDir ); + // Finds a path around dynamic obstacles. + static bool FindPathAroundObstacles(const idPhysics* physics, const idAAS* aas, const idEntity* ignore, const idVec3& startPos, const idVec3& seekPos, obstaclePath_t& path); + // Frees any nodes used for the dynamic obstacle avoidance. + static void FreeObstacleAvoidanceNodes(void); + // Predicts movement, returns true if a stop event was triggered. + static bool PredictPath(const idEntity* ent, const idAAS* aas, const idVec3& start, const idVec3& velocity, int totalTime, int frameTime, int stopEvent, predictedPath_t& path); + // Return true if the trajectory of the clip model is collision free. + static bool TestTrajectory(const idVec3& start, const idVec3& end, float zVel, float gravity, float time, float max_height, const idClipModel* clip, int clipmask, const idEntity* ignore, const idEntity* targetEntity, int drawtime); + // Finds the best collision free trajectory for a clip model. + static bool PredictTrajectory(const idVec3& firePos, const idVec3& target, float projectileSpeed, const idVec3& projGravity, const idClipModel* clip, int clipmask, float max_height, const idEntity* ignore, const idEntity* targetEntity, int drawtime, idVec3& aimDir); protected: // navigation - idAAS * aas; + idAAS* aas; int travelFlags; idMoveState move; @@ -315,7 +315,7 @@ protected: bool allowHiddenMovement; // allows character to still move around while hidden bool disableGravity; // disables gravity and allows vertical movement by the animation bool af_push_moveables; // allow the articulated figure to push moveable objects - + // weapon/attack vars bool lastHitCheckResult; int lastHitCheckTime; @@ -324,8 +324,8 @@ protected: float projectile_height_to_distance_ratio; // calculates the maximum height a projectile can be thrown idList missileLaunchOffset; - const idDict * projectileDef; - mutable idClipModel *projectileClipModel; + const idDict* projectileDef; + mutable idClipModel* projectileClipModel; float projectileRadius; float projectileSpeed; idVec3 projectileVelocity; @@ -334,7 +334,7 @@ protected: idStr attack; // chatter/talking - const idSoundShader *chat_snd; + const idSoundShader* chat_snd; int chat_min; int chat_max; int chat_time; @@ -367,7 +367,7 @@ protected: // special fx float shrivel_rate; int shrivel_start; - + bool restartParticles; // should smoke emissions restart bool useBoneAxis; // use the bone vs the model axis idList particles; // particle data @@ -416,393 +416,375 @@ protected: // // ai/ai.cpp // - void SetAAS( void ); - virtual void DormantBegin( void ); // called when entity becomes dormant - virtual void DormantEnd( void ); // called when entity wakes from being dormant - void Think( void ); - void Activate( idEntity *activator ); - int ReactionTo( const idEntity *ent ); - bool CheckForEnemy( void ); - void EnemyDead( void ); - virtual bool CanPlayChatterSounds( void ) const; - void SetChatSound( void ); - void PlayChatter( void ); - virtual void Hide( void ); - virtual void Show( void ); - idVec3 FirstVisiblePointOnPath( const idVec3 origin, const idVec3 &target, int travelFlags ) const; - void CalculateAttackOffsets( void ); - void PlayCinematic( void ); + void SetAAS(void); + virtual void DormantBegin(void); // called when entity becomes dormant + virtual void DormantEnd(void); // called when entity wakes from being dormant + void Think(void); + void Activate(idEntity* activator); + int ReactionTo(const idEntity* ent); + bool CheckForEnemy(void); + void EnemyDead(void); + virtual bool CanPlayChatterSounds(void) const; + void SetChatSound(void); + void PlayChatter(void); + virtual void Hide(void); + virtual void Show(void); + idVec3 FirstVisiblePointOnPath(const idVec3 origin, const idVec3& target, int travelFlags) const; + void CalculateAttackOffsets(void); + void PlayCinematic(void); // movement - virtual void ApplyImpulse( idEntity *ent, int id, const idVec3 &point, const idVec3 &impulse ); - void GetMoveDelta( const idMat3 &oldaxis, const idMat3 &axis, idVec3 &delta ); - void CheckObstacleAvoidance( const idVec3 &goalPos, idVec3 &newPos ); - void DeadMove( void ); - void AnimMove( void ); - void SlideMove( void ); - void AdjustFlyingAngles( void ); - void AddFlyBob( idVec3 &vel ); - void AdjustFlyHeight( idVec3 &vel, const idVec3 &goalPos ); - void FlySeekGoal( idVec3 &vel, idVec3 &goalPos ); - void AdjustFlySpeed( idVec3 &vel ); - void FlyTurn( void ); - void FlyMove( void ); - void StaticMove( void ); + virtual void ApplyImpulse(idEntity* ent, int id, const idVec3& point, const idVec3& impulse); + void GetMoveDelta(const idMat3& oldaxis, const idMat3& axis, idVec3& delta); + void CheckObstacleAvoidance(const idVec3& goalPos, idVec3& newPos); + void DeadMove(void); + void AnimMove(void); + void SlideMove(void); + void AdjustFlyingAngles(void); + void AddFlyBob(idVec3& vel); + void AdjustFlyHeight(idVec3& vel, const idVec3& goalPos); + void FlySeekGoal(idVec3& vel, idVec3& goalPos); + void AdjustFlySpeed(idVec3& vel); + void FlyTurn(void); + void FlyMove(void); + void StaticMove(void); // damage - virtual bool Pain( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location ); - virtual void Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location ); + virtual bool Pain(idEntity* inflictor, idEntity* attacker, int damage, const idVec3& dir, int location); + virtual void Killed(idEntity* inflictor, idEntity* attacker, int damage, const idVec3& dir, int location); // navigation - void KickObstacles( const idVec3 &dir, float force, idEntity *alwaysKick ); - bool ReachedPos( const idVec3 &pos, const moveCommand_t moveCommand ) const; - float TravelDistance( const idVec3 &start, const idVec3 &end ) const; - int PointReachableAreaNum( const idVec3 &pos, const float boundsScale = 2.0f ) const; - bool PathToGoal( aasPath_t &path, int areaNum, const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const; - void DrawRoute( void ) const; - bool GetMovePos( idVec3 &seekPos ); - bool MoveDone( void ) const; - bool EntityCanSeePos( idActor *actor, const idVec3 &actorOrigin, const idVec3 &pos ); - void BlockedFailSafe( void ); + void KickObstacles(const idVec3& dir, float force, idEntity* alwaysKick); + bool ReachedPos(const idVec3& pos, const moveCommand_t moveCommand) const; + float TravelDistance(const idVec3& start, const idVec3& end) const; + int PointReachableAreaNum(const idVec3& pos, const float boundsScale = 2.0f) const; + bool PathToGoal(aasPath_t& path, int areaNum, const idVec3& origin, int goalAreaNum, const idVec3& goalOrigin) const; + void DrawRoute(void) const; + bool GetMovePos(idVec3& seekPos); + bool MoveDone(void) const; + bool EntityCanSeePos(idActor* actor, const idVec3& actorOrigin, const idVec3& pos); + void BlockedFailSafe(void); // movement control - void StopMove( moveStatus_t status ); - bool FaceEnemy( void ); - bool FaceEntity( idEntity *ent ); - bool DirectMoveToPosition( const idVec3 &pos ); - bool MoveToEnemyHeight( void ); - bool MoveOutOfRange( idEntity *entity, float range ); - bool MoveToAttackPosition( idEntity *ent, int attack_anim ); - bool MoveToEnemy( void ); - bool MoveToEntity( idEntity *ent ); - bool MoveToPosition( const idVec3 &pos ); - bool MoveToCover( idEntity *entity, const idVec3 &pos ); - bool SlideToPosition( const idVec3 &pos, float time ); - bool WanderAround( void ); - bool StepDirection( float dir ); - bool NewWanderDir( const idVec3 &dest ); + void StopMove(moveStatus_t status); + bool FaceEnemy(void); + bool FaceEntity(idEntity* ent); + bool DirectMoveToPosition(const idVec3& pos); + bool MoveToEnemyHeight(void); + bool MoveOutOfRange(idEntity* entity, float range); + bool MoveToAttackPosition(idEntity* ent, int attack_anim); + bool MoveToEnemy(void); + bool MoveToEntity(idEntity* ent); + bool MoveToPosition(const idVec3& pos); + bool MoveToCover(idEntity* entity, const idVec3& pos); + bool SlideToPosition(const idVec3& pos, float time); + bool WanderAround(void); + bool StepDirection(float dir); + bool NewWanderDir(const idVec3& dest); // effects - const idDeclParticle *SpawnParticlesOnJoint( particleEmitter_t &pe, const char *particleName, const char *jointName ); - void SpawnParticles( const char *keyName ); - bool ParticlesActive( void ); + const idDeclParticle* SpawnParticlesOnJoint(particleEmitter_t& pe, const char* particleName, const char* jointName); + void SpawnParticles(const char* keyName); + bool ParticlesActive(void); // turning - bool FacingIdeal( void ); - void Turn( void ); - bool TurnToward( float yaw ); - bool TurnToward( const idVec3 &pos ); + bool FacingIdeal(void); + void Turn(void); + bool TurnToward(float yaw); + bool TurnToward(const idVec3& pos); // enemy management - void ClearEnemy( void ); - bool EnemyPositionValid( void ) const; - void SetEnemyPosition( void ); - void UpdateEnemyPosition( void ); - void SetEnemy( idActor *newEnemy ); + void ClearEnemy(void); + bool EnemyPositionValid(void) const; + void SetEnemyPosition(void); + void UpdateEnemyPosition(void); + void SetEnemy(idActor* newEnemy); // attacks - void CreateProjectileClipModel( void ) const; - idProjectile *CreateProjectile( const idVec3 &pos, const idVec3 &dir ); - void RemoveProjectile( void ); - idProjectile *LaunchProjectile( const char *jointname, idEntity *target, bool clampToAttackCone ); - virtual void DamageFeedback( idEntity *victim, idEntity *inflictor, int &damage ); - void DirectDamage( const char *meleeDefName, idEntity *ent ); - bool TestMelee( void ) const; - bool AttackMelee( const char *meleeDefName ); - void BeginAttack( const char *name ); - void EndAttack( void ); - void PushWithAF( void ); + void CreateProjectileClipModel(void) const; + idProjectile* CreateProjectile(const idVec3& pos, const idVec3& dir); + void RemoveProjectile(void); + idProjectile* LaunchProjectile(const char* jointname, idEntity* target, bool clampToAttackCone); + virtual void DamageFeedback(idEntity* victim, idEntity* inflictor, int& damage); + void DirectDamage(const char* meleeDefName, idEntity* ent); + bool TestMelee(void) const; + bool AttackMelee(const char* meleeDefName); + void BeginAttack(const char* name); + void EndAttack(void); + void PushWithAF(void); // special effects - void GetMuzzle( const char *jointname, idVec3 &muzzle, idMat3 &axis ); - void InitMuzzleFlash( void ); - void TriggerWeaponEffects( const idVec3 &muzzle ); - void UpdateMuzzleFlash( void ); - virtual bool UpdateAnimationControllers( void ); - void UpdateParticles( void ); - void TriggerParticles( const char *jointName ); + void GetMuzzle(const char* jointname, idVec3& muzzle, idMat3& axis); + void InitMuzzleFlash(void); + void TriggerWeaponEffects(const idVec3& muzzle); + void UpdateMuzzleFlash(void); + virtual bool UpdateAnimationControllers(void); + void UpdateParticles(void); + void TriggerParticles(const char* jointName); // AI script state management - void LinkScriptVariables( void ); - void UpdateAIScript( void ); + void LinkScriptVariables(void); + void UpdateAIScript(void); // // ai/ai_events.cpp // + void Touch(idEntity* other, trace_t* trace); + idEntity* FindEnemy(int useFOV); + idEntity* FindEnemyAI(int useFOV); + idEntity* FindEnemyInCombatNodes(void); + idEntity* ClosestReachableEnemyOfEntity(idEntity* team_mate); + idEntity* HeardSound(int ignore_team); + void SetEnemy(idEntity* ent); + void MuzzleFlash(const char* jointname); + idEntity* CreateMissile(const char* jointname); + idEntity* AttackMissile(const char* jointname); + idEntity* FireMissileAtTarget(const char* jointname, const char* targetname); + idEntity* LaunchMissile(const idVec3& org, const idAngles& ang); + void DirectDamage(idEntity* damageTarget, const char* damageDefName); + void RadiusDamageFromJoint(const char* jointname, const char* damageDefName); + idEntity* RandomPath(void); + int MeleeAttackToJoint(const char* jointname, const char* meleeDefName); + float CanBecomeSolid(void); + void BecomeSolid(void); + void BecomeNonSolid(void); + int BecomeRagdoll(void); + void StopRagdoll(void); + void SetHealth(float newHealth); + float GetHealth(void); + void AllowDamage(void); + void IgnoreDamage(void); + float GetCurrentYaw(void); + void TurnTo(float angle); + void TurnToPos(const idVec3& pos); + void TurnToEntity(idEntity* ent); + int MoveStatus(void); + void StopMove(void); + void MoveToCover(void); + void SlideTo(const idVec3& pos, float time); + void Wander(void); + idEntity* GetCombatNode(void); + int EnemyInCombatCone(idEntity* ent, int use_current_enemy_location); + idVec3 GetJumpVelocity(const idVec3& pos, float speed, float max_height); + int EntityInAttackCone(idEntity* ent); + int CanSeeEntity(idEntity* ent); + void SetTalkTarget(idEntity* target); + idEntity* GetTalkTarget(void); + void SetTalkState(int state); + float EnemyRange(void); + float EnemyRange2D(void); + idVec3 GetEnemyPos(void); + idVec3 GetEnemyEyePos(void); + idVec3 PredictEnemyPos(float time); + int CanHitEnemy(void); + int CanHitEnemyFromAnim(const char* animname); + int CanHitEnemyFromJoint(const char* jointname); + void ChargeAttack(const char* damageDef); + float TestChargeAttack(void); + int TestAnimMoveTowardEnemy(const char* animname); + int TestAnimMove(const char* animname); + int TestMoveToPosition(const idVec3& position); + int TestMeleeAttack(void); + int TestAnimAttack(const char* animname); + void PreBurn(void); + void Burn(void); + void ClearBurn(void); + void SetSmokeVisibility(int num, int on); + int NumSmokeEmitters(void); + void StopThinking(void); + float GetTurnDelta(void); + int GetMoveType(void); + void SetMoveType(int moveType); + void SaveMove(void); + void RestoreMove(void); + void AllowMovement(float flag); + void JumpFrame(void); + void EnableClip(void); + void DisableClip(void); + void EnableGravity(void); + void DisableGravity(void); + void EnableAFPush(void); + void DisableAFPush(void); + void SetFlySpeed(float speed); + void SetFlyOffset(int offset); + void ClearFlyOffset(void); + idEntity* GetClosestHiddenTarget(const char* type); + idEntity* GetRandomTarget(const char* type); + float TravelDistanceToPoint(const idVec3& pos); + float TravelDistanceToEntity(idEntity* ent); + float TravelDistanceBetweenPoints(const idVec3& source, const idVec3& dest); + float TravelDistanceBetweenEntities(idEntity* source, idEntity* dest); + void LookAtEntity(idEntity* ent, float duration); + void LookAtEnemy(float duration); + void SetJointMod(int allow); + void ThrowMoveable(void); + void ThrowAF(void); + void SetAngles(idAngles const& ang); + idVec3 GetAngles(void); + void RealKill(void); + void Kill(void); + void WakeOnFlashlight(int enable); + void LocateEnemy(void); + void KickObstacles(idEntity* kickEnt, float force); + idEntity* GetObstacle(void); + idVec3 PushPointIntoAAS(const idVec3& pos); + float GetTurnRate(void); + void SetTurnRate(float rate); + void AnimTurn(float angles); + void AllowHiddenMovement(int enable); + idEntity* FindActorsInBounds(const idVec3& mins, const idVec3& maxs); + int CanReachPosition(const idVec3& pos); + int CanReachEntity(idEntity* ent); + int CanReachEnemy(void); + idVec3 GetReachableEntityPosition(idEntity* ent); + void WaitAction(const char* waitForState); + bool WaitActionDone(void) const; + bool WaitMoveDone(void) const; + bool Shrivel(float shrivel_time, bool firstFrame); - void Native_Activate(idEntity* activator); - void Native_Touch(idEntity* other, trace_t* trace); - idEntity* Native_FindEnemy(int useFOV); - idEntity* Native_FindEnemyAI(int useFOV); - idEntity* Native_FindEnemyInCombatNodes(void); - idEntity* Native_ClosestReachableEnemyOfEntity(idEntity* team_mate); - idEntity* Native_HeardSound(int ignore_team); - void Native_SetEnemy(idEntity* ent); - void Native_ClearEnemy(void); - void Native_MuzzleFlash(const char* jointname); - idEntity* Native_CreateMissile(const char* jointname); - idEntity* Native_AttackMissile(const char* jointname); - idEntity* Native_FireMissileAtTarget(const char* jointname, const char* targetname); - idEntity* Native_LaunchMissile(const idVec3& org, const idAngles& ang); - int Native_AttackMelee(const char* meleeDefName); - void Native_DirectDamage(idEntity* damageTarget, const char* damageDefName); - void Native_RadiusDamageFromJoint(const char* jointname, const char* damageDefName); - idEntity* Native_RandomPath(void); - void Native_BeginAttack(const char* name); - void Native_EndAttack(void); - int Native_MeleeAttackToJoint(const char* jointname, const char* meleeDefName); - float Native_CanBecomeSolid(void); - void Native_BecomeSolid(void); - void Native_BecomeNonSolid(void); - int Native_BecomeRagdoll(void); - void Native_StopRagdoll(void); - void Native_SetHealth(float newHealth); - float Native_GetHealth(void); - void Native_AllowDamage(void); - void Native_IgnoreDamage(void); - float Native_GetCurrentYaw(void); - void Native_TurnTo(float angle); - void Native_TurnToPos(const idVec3& pos); - void Native_TurnToEntity(idEntity* ent); - int Native_MoveStatus(void); - void Native_StopMove(void); - void Native_MoveToCover(void); - void Native_MoveToEnemy(void); - void Native_MoveToEnemyHeight(void); - void Native_MoveOutOfRange(idEntity* entity, float range); - void Native_MoveToAttackPosition(idEntity* entity, const char* attack_anim); - void Native_MoveToEntity(idEntity* ent); - void Native_MoveToPosition(const idVec3& pos); - void Native_SlideTo(const idVec3& pos, float time); - void Native_Wander(void); - int Native_FacingIdeal(void); - void Native_FaceEnemy(void); - void Native_FaceEntity(idEntity* ent); - idEntity* Native_GetCombatNode(void); - int Native_EnemyInCombatCone(idEntity* ent, int use_current_enemy_location); - idVec3 Native_GetJumpVelocity(const idVec3& pos, float speed, float max_height); - int Native_EntityInAttackCone(idEntity* ent); - int Native_CanSeeEntity(idEntity* ent); - void Native_SetTalkTarget(idEntity* target); - idEntity* Native_GetTalkTarget(void); - void Native_SetTalkState(int state); - float Native_EnemyRange(void); - float Native_EnemyRange2D(void); - idEntity* Native_GetEnemy(void); - idVec3 Native_GetEnemyPos(void); - idVec3 Native_GetEnemyEyePos(void); - idVec3 Native_PredictEnemyPos(float time); - int Native_CanHitEnemy(void); - int Native_CanHitEnemyFromAnim(const char* animname); - int Native_CanHitEnemyFromJoint(const char* jointname); - int Native_EnemyPositionValid(void); - void Native_ChargeAttack(const char* damageDef); - float Native_TestChargeAttack(void); - int Native_TestAnimMoveTowardEnemy(const char* animname); - int Native_TestAnimMove(const char* animname); - int Native_TestMoveToPosition(const idVec3& position); - int Native_TestMeleeAttack(void); - int Native_TestAnimAttack(const char* animname); - void Native_PreBurn(void); - void Native_Burn(void); - void Native_ClearBurn(void); - void Native_SetSmokeVisibility(int num, int on); - int Native_NumSmokeEmitters(void); - void Native_StopThinking(void); - float Native_GetTurnDelta(void); - int Native_GetMoveType(void); - void Native_SetMoveType(int moveType); - void Native_SaveMove(void); - void Native_RestoreMove(void); - void Native_AllowMovement(float flag); - void Native_JumpFrame(void); - void Native_EnableClip(void); - void Native_DisableClip(void); - void Native_EnableGravity(void); - void Native_DisableGravity(void); - void Native_EnableAFPush(void); - void Native_DisableAFPush(void); - void Native_SetFlySpeed(float speed); - void Native_SetFlyOffset(int offset); - void Native_ClearFlyOffset(void); - idEntity* Native_GetClosestHiddenTarget(const char* type); - idEntity* Native_GetRandomTarget(const char* type); - float Native_TravelDistanceToPoint(const idVec3& pos); - float Native_TravelDistanceToEntity(idEntity* ent); - float Native_TravelDistanceBetweenPoints(const idVec3& source, const idVec3& dest); - float Native_TravelDistanceBetweenEntities(idEntity* source, idEntity* dest); - void Native_LookAtEntity(idEntity* ent, float duration); - void Native_LookAtEnemy(float duration); - void Native_SetJointMod(int allow); - void Native_ThrowMoveable(void); - void Native_ThrowAF(void); - void Native_SetAngles(idAngles const& ang); - idVec3 Native_GetAngles(void); - void Native_RealKill(void); - void Native_Kill(void); - void Native_WakeOnFlashlight(int enable); - void Native_LocateEnemy(void); - void Native_KickObstacles(idEntity* kickEnt, float force); - idEntity* Native_GetObstacle(void); - idVec3 Native_PushPointIntoAAS(const idVec3& pos); - float Native_GetTurnRate(void); - void Native_SetTurnRate(float rate); - void Native_AnimTurn(float angles); - void Native_AllowHiddenMovement(int enable); - void Native_TriggerParticles(const char* jointName); - idEntity* Native_FindActorsInBounds(const idVec3& mins, const idVec3& maxs); - int Native_CanReachPosition(const idVec3& pos); - int Native_CanReachEntity(idEntity* ent); - int Native_CanReachEnemy(void); - idVec3 Native_GetReachableEntityPosition(idEntity* ent); - void Native_WaitAction(const char* waitForState); - bool Native_WaitActionDone(void) const; - bool Native_WaitMoveDone(void) const; - bool Native_Shrivel(float shrivel_time, bool firstFrame); - - void Event_Activate( idEntity *activator ); - void Event_Touch( idEntity *other, trace_t *trace ); - void Event_FindEnemy( int useFOV ); - void Event_FindEnemyAI( int useFOV ); - void Event_FindEnemyInCombatNodes( void ); - void Event_ClosestReachableEnemyOfEntity( idEntity *team_mate ); - void Event_HeardSound( int ignore_team ); - void Event_SetEnemy( idEntity *ent ); - void Event_ClearEnemy( void ); - void Event_MuzzleFlash( const char *jointname ); - void Event_CreateMissile( const char *jointname ); - void Event_AttackMissile( const char *jointname ); - void Event_FireMissileAtTarget( const char *jointname, const char *targetname ); - void Event_LaunchMissile( const idVec3 &muzzle, const idAngles &ang ); - void Event_AttackMelee( const char *meleeDefName ); - void Event_DirectDamage( idEntity *damageTarget, const char *damageDefName ); - void Event_RadiusDamageFromJoint( const char *jointname, const char *damageDefName ); - void Event_BeginAttack( const char *name ); - void Event_EndAttack( void ); - void Event_MeleeAttackToJoint( const char *jointname, const char *meleeDefName ); - void Event_RandomPath( void ); - void Event_CanBecomeSolid( void ); - void Event_BecomeSolid( void ); - void Event_BecomeNonSolid( void ); - void Event_BecomeRagdoll( void ); - void Event_StopRagdoll( void ); - void Event_SetHealth( float newHealth ); - void Event_GetHealth( void ); - void Event_AllowDamage( void ); - void Event_IgnoreDamage( void ); - void Event_GetCurrentYaw( void ); - void Event_TurnTo( float angle ); - void Event_TurnToPos( const idVec3 &pos ); - void Event_TurnToEntity( idEntity *ent ); - void Event_MoveStatus( void ); - void Event_StopMove( void ); - void Event_MoveToCover( void ); - void Event_MoveToEnemy( void ); - void Event_MoveToEnemyHeight( void ); - void Event_MoveOutOfRange( idEntity *entity, float range ); - void Event_MoveToAttackPosition( idEntity *entity, const char *attack_anim ); - void Event_MoveToEntity( idEntity *ent ); - void Event_MoveToPosition( const idVec3 &pos ); - void Event_SlideTo( const idVec3 &pos, float time ); - void Event_Wander( void ); - void Event_FacingIdeal( void ); - void Event_FaceEnemy( void ); - void Event_FaceEntity( idEntity *ent ); - void Event_WaitAction( const char *waitForState ); - void Event_GetCombatNode( void ); - void Event_EnemyInCombatCone( idEntity *ent, int use_current_enemy_location ); - void Event_WaitMove( void ); - void Event_GetJumpVelocity( const idVec3 &pos, float speed, float max_height ); - void Event_EntityInAttackCone( idEntity *ent ); - void Event_CanSeeEntity( idEntity *ent ); - void Event_SetTalkTarget( idEntity *target ); - void Event_GetTalkTarget( void ); - void Event_SetTalkState( int state ); - void Event_EnemyRange( void ); - void Event_EnemyRange2D( void ); - void Event_GetEnemy( void ); - void Event_GetEnemyPos( void ); - void Event_GetEnemyEyePos( void ); - void Event_PredictEnemyPos( float time ); - void Event_CanHitEnemy( void ); - void Event_CanHitEnemyFromAnim( const char *animname ); - void Event_CanHitEnemyFromJoint( const char *jointname ); - void Event_EnemyPositionValid( void ); - void Event_ChargeAttack( const char *damageDef ); - void Event_TestChargeAttack( void ); - void Event_TestAnimMoveTowardEnemy( const char *animname ); - void Event_TestAnimMove( const char *animname ); - void Event_TestMoveToPosition( const idVec3 &position ); - void Event_TestMeleeAttack( void ); - void Event_TestAnimAttack( const char *animname ); - void Event_Shrivel( float shirvel_time ); - void Event_Burn( void ); - void Event_PreBurn( void ); - void Event_ClearBurn( void ); - void Event_SetSmokeVisibility( int num, int on ); - void Event_NumSmokeEmitters( void ); - void Event_StopThinking( void ); - void Event_GetTurnDelta( void ); - void Event_GetMoveType( void ); - void Event_SetMoveType( int moveType ); - void Event_SaveMove( void ); - void Event_RestoreMove( void ); - void Event_AllowMovement( float flag ); - void Event_JumpFrame( void ); - void Event_EnableClip( void ); - void Event_DisableClip( void ); - void Event_EnableGravity( void ); - void Event_DisableGravity( void ); - void Event_EnableAFPush( void ); - void Event_DisableAFPush( void ); - void Event_SetFlySpeed( float speed ); - void Event_SetFlyOffset( int offset ); - void Event_ClearFlyOffset( void ); - void Event_GetClosestHiddenTarget( const char *type ); - void Event_GetRandomTarget( const char *type ); - void Event_TravelDistanceToPoint( const idVec3 &pos ); - void Event_TravelDistanceToEntity( idEntity *ent ); - void Event_TravelDistanceBetweenPoints( const idVec3 &source, const idVec3 &dest ); - void Event_TravelDistanceBetweenEntities( idEntity *source, idEntity *dest ); - void Event_LookAtEntity( idEntity *ent, float duration ); - void Event_LookAtEnemy( float duration ); - void Event_SetJointMod( int allowJointMod ); - void Event_ThrowMoveable( void ); - void Event_ThrowAF( void ); - void Event_SetAngles( idAngles const &ang ); - void Event_GetAngles( void ); - void Event_RealKill( void ); - void Event_Kill( void ); - void Event_WakeOnFlashlight( int enable ); - void Event_LocateEnemy( void ); - void Event_KickObstacles( idEntity *kickEnt, float force ); - void Event_GetObstacle( void ); - void Event_PushPointIntoAAS( const idVec3 &pos ); - void Event_GetTurnRate( void ); - void Event_SetTurnRate( float rate ); - void Event_AnimTurn( float angles ); - void Event_AllowHiddenMovement( int enable ); - void Event_TriggerParticles( const char *jointName ); - void Event_FindActorsInBounds( const idVec3 &mins, const idVec3 &maxs ); - void Event_CanReachPosition( const idVec3 &pos ); - void Event_CanReachEntity( idEntity *ent ); - void Event_CanReachEnemy( void ); - void Event_GetReachableEntityPosition( idEntity *ent ); + void Event_Activate(idEntity* activator); + void Event_Touch(idEntity* other, trace_t* trace); + void Event_FindEnemy(int useFOV); + void Event_FindEnemyAI(int useFOV); + void Event_FindEnemyInCombatNodes(void); + void Event_ClosestReachableEnemyOfEntity(idEntity* team_mate); + void Event_HeardSound(int ignore_team); + void Event_SetEnemy(idEntity* ent); + void Event_ClearEnemy(void); + void Event_MuzzleFlash(const char* jointname); + void Event_CreateMissile(const char* jointname); + void Event_AttackMissile(const char* jointname); + void Event_FireMissileAtTarget(const char* jointname, const char* targetname); + void Event_LaunchMissile(const idVec3& muzzle, const idAngles& ang); + void Event_AttackMelee(const char* meleeDefName); + void Event_DirectDamage(idEntity* damageTarget, const char* damageDefName); + void Event_RadiusDamageFromJoint(const char* jointname, const char* damageDefName); + void Event_BeginAttack(const char* name); + void Event_EndAttack(void); + void Event_MeleeAttackToJoint(const char* jointname, const char* meleeDefName); + void Event_RandomPath(void); + void Event_CanBecomeSolid(void); + void Event_BecomeSolid(void); + void Event_BecomeNonSolid(void); + void Event_BecomeRagdoll(void); + void Event_StopRagdoll(void); + void Event_SetHealth(float newHealth); + void Event_GetHealth(void); + void Event_AllowDamage(void); + void Event_IgnoreDamage(void); + void Event_GetCurrentYaw(void); + void Event_TurnTo(float angle); + void Event_TurnToPos(const idVec3& pos); + void Event_TurnToEntity(idEntity* ent); + void Event_MoveStatus(void); + void Event_StopMove(void); + void Event_MoveToCover(void); + void Event_MoveToEnemy(void); + void Event_MoveToEnemyHeight(void); + void Event_MoveOutOfRange(idEntity* entity, float range); + void Event_MoveToAttackPosition(idEntity* entity, const char* attack_anim); + void Event_MoveToEntity(idEntity* ent); + void Event_MoveToPosition(const idVec3& pos); + void Event_SlideTo(const idVec3& pos, float time); + void Event_Wander(void); + void Event_FacingIdeal(void); + void Event_FaceEnemy(void); + void Event_FaceEntity(idEntity* ent); + void Event_WaitAction(const char* waitForState); + void Event_GetCombatNode(void); + void Event_EnemyInCombatCone(idEntity* ent, int use_current_enemy_location); + void Event_WaitMove(void); + void Event_GetJumpVelocity(const idVec3& pos, float speed, float max_height); + void Event_EntityInAttackCone(idEntity* ent); + void Event_CanSeeEntity(idEntity* ent); + void Event_SetTalkTarget(idEntity* target); + void Event_GetTalkTarget(void); + void Event_SetTalkState(int state); + void Event_EnemyRange(void); + void Event_EnemyRange2D(void); + void Event_GetEnemy(void); + void Event_GetEnemyPos(void); + void Event_GetEnemyEyePos(void); + void Event_PredictEnemyPos(float time); + void Event_CanHitEnemy(void); + void Event_CanHitEnemyFromAnim(const char* animname); + void Event_CanHitEnemyFromJoint(const char* jointname); + void Event_EnemyPositionValid(void); + void Event_ChargeAttack(const char* damageDef); + void Event_TestChargeAttack(void); + void Event_TestAnimMoveTowardEnemy(const char* animname); + void Event_TestAnimMove(const char* animname); + void Event_TestMoveToPosition(const idVec3& position); + void Event_TestMeleeAttack(void); + void Event_TestAnimAttack(const char* animname); + void Event_Shrivel(float shirvel_time); + void Event_Burn(void); + void Event_PreBurn(void); + void Event_ClearBurn(void); + void Event_SetSmokeVisibility(int num, int on); + void Event_NumSmokeEmitters(void); + void Event_StopThinking(void); + void Event_GetTurnDelta(void); + void Event_GetMoveType(void); + void Event_SetMoveType(int moveType); + void Event_SaveMove(void); + void Event_RestoreMove(void); + void Event_AllowMovement(float flag); + void Event_JumpFrame(void); + void Event_EnableClip(void); + void Event_DisableClip(void); + void Event_EnableGravity(void); + void Event_DisableGravity(void); + void Event_EnableAFPush(void); + void Event_DisableAFPush(void); + void Event_SetFlySpeed(float speed); + void Event_SetFlyOffset(int offset); + void Event_ClearFlyOffset(void); + void Event_GetClosestHiddenTarget(const char* type); + void Event_GetRandomTarget(const char* type); + void Event_TravelDistanceToPoint(const idVec3& pos); + void Event_TravelDistanceToEntity(idEntity* ent); + void Event_TravelDistanceBetweenPoints(const idVec3& source, const idVec3& dest); + void Event_TravelDistanceBetweenEntities(idEntity* source, idEntity* dest); + void Event_LookAtEntity(idEntity* ent, float duration); + void Event_LookAtEnemy(float duration); + void Event_SetJointMod(int allowJointMod); + void Event_ThrowMoveable(void); + void Event_ThrowAF(void); + void Event_SetAngles(idAngles const& ang); + void Event_GetAngles(void); + void Event_RealKill(void); + void Event_Kill(void); + void Event_WakeOnFlashlight(int enable); + void Event_LocateEnemy(void); + void Event_KickObstacles(idEntity* kickEnt, float force); + void Event_GetObstacle(void); + void Event_PushPointIntoAAS(const idVec3& pos); + void Event_GetTurnRate(void); + void Event_SetTurnRate(float rate); + void Event_AnimTurn(float angles); + void Event_AllowHiddenMovement(int enable); + void Event_TriggerParticles(const char* jointName); + void Event_FindActorsInBounds(const idVec3& mins, const idVec3& maxs); + void Event_CanReachPosition(const idVec3& pos); + void Event_CanReachEntity(idEntity* ent); + void Event_CanReachEnemy(void); + void Event_GetReachableEntityPosition(idEntity* ent); }; class idCombatNode : public idEntity { public: - CLASS_PROTOTYPE( idCombatNode ); + CLASS_PROTOTYPE(idCombatNode); - idCombatNode(); + idCombatNode(); - void Save( idSaveGame *savefile ) const; - void Restore( idRestoreGame *savefile ); + void Save(idSaveGame* savefile) const; + void Restore(idRestoreGame* savefile); - void Spawn( void ); - bool IsDisabled( void ) const; - bool EntityInView( idActor *actor, const idVec3 &pos ); - static void DrawDebugInfo( void ); + void Spawn(void); + bool IsDisabled(void) const; + bool EntityInView(idActor* actor, const idVec3& pos); + static void DrawDebugInfo(void); private: float min_dist; @@ -815,8 +797,8 @@ private: idVec3 offset; bool disabled; - void Event_Activate( idEntity *activator ); - void Event_MarkUsed( void ); + void Event_Activate(idEntity* activator); + void Event_MarkUsed(void); }; #endif /* !__AI_H__ */ diff --git a/neo/doom3/game/ai/AI_events.cpp b/neo/doom3/game/ai/AI_events.cpp index 4cd7ca11..2eff6d32 100644 --- a/neo/doom3/game/ai/AI_events.cpp +++ b/neo/doom3/game/ai/AI_events.cpp @@ -296,19 +296,10 @@ END_CLASS /* ===================== -idAI::Native_Activate +idAI::Touch ===================== */ -void idAI::Native_Activate(idEntity* activator) { - Activate(activator); -} - -/* -===================== -idAI::Native_Touch -===================== -*/ -void idAI::Native_Touch(idEntity* other, trace_t* trace) { +void idAI::Touch(idEntity* other, trace_t* trace) { if (!enemy.GetEntity() && !other->fl.notarget && (ReactionTo(other) & ATTACK_ON_ACTIVATE)) { Activate(other); } @@ -317,10 +308,10 @@ void idAI::Native_Touch(idEntity* other, trace_t* trace) { /* ===================== -idAI::Native_FindEnemy +idAI::FindEnemy ===================== */ -idEntity* idAI::Native_FindEnemy(int useFOV) { +idEntity* idAI::FindEnemy(int useFOV) { int i; idEntity* ent; idActor* actor; @@ -340,7 +331,6 @@ idEntity* idAI::Native_FindEnemy(int useFOV) { if (CanSee(actor, useFOV != 0)) { return actor; - return NULL; } } } @@ -350,10 +340,10 @@ idEntity* idAI::Native_FindEnemy(int useFOV) { /* ===================== -idAI::Native_FindEnemyAI +idAI::FindEnemyAI ===================== */ -idEntity* idAI::Native_FindEnemyAI(int useFOV) { +idEntity* idAI::FindEnemyAI(int useFOV) { idEntity* ent; idActor* actor; idActor* bestEnemy; @@ -394,10 +384,10 @@ idEntity* idAI::Native_FindEnemyAI(int useFOV) { /* ===================== -idAI::Native_FindEnemyInCombatNodes +idAI::FindEnemyInCombatNodes ===================== */ -idEntity* idAI::Native_FindEnemyInCombatNodes(void) { +idEntity* idAI::FindEnemyInCombatNodes(void) { int i, j; idCombatNode* node; idEntity* ent; @@ -407,7 +397,6 @@ idEntity* idAI::Native_FindEnemyInCombatNodes(void) { if (!gameLocal.InPlayerPVS(this)) { // don't locate the player when we're not in his PVS return NULL; - return NULL; } for (i = 0; i < gameLocal.numClients; i++) { @@ -431,7 +420,6 @@ idEntity* idAI::Native_FindEnemyInCombatNodes(void) { node = static_cast(targetEnt); if (!node->IsDisabled() && node->EntityInView(actor, actor->GetPhysics()->GetOrigin())) { return actor; - return NULL; } } } @@ -441,10 +429,10 @@ idEntity* idAI::Native_FindEnemyInCombatNodes(void) { /* ===================== -idAI::Native_ClosestReachableEnemyOfEntity +idAI::ClosestReachableEnemyOfEntity ===================== */ -idEntity* idAI::Native_ClosestReachableEnemyOfEntity(idEntity* team_mate) { +idEntity* idAI::ClosestReachableEnemyOfEntity(idEntity* team_mate) { idActor* actor; idActor* ent; idActor* bestEnt; @@ -487,10 +475,10 @@ idEntity* idAI::Native_ClosestReachableEnemyOfEntity(idEntity* team_mate) { /* ===================== -idAI::Native_HeardSound +idAI::HeardSound ===================== */ -idEntity* idAI::Native_HeardSound(int ignore_team) { +idEntity* idAI::HeardSound(int ignore_team) { // check if we heard any sounds in the last frame idActor* actor = gameLocal.GetAlertEntity(); if (actor && (!ignore_team || (ReactionTo(actor) & ATTACK_ON_SIGHT)) && gameLocal.InPlayerPVS(this)) { @@ -499,7 +487,6 @@ idEntity* idAI::Native_HeardSound(int ignore_team) { float dist = (pos - org).LengthSqr(); if (dist < Square(AI_HEARING_RANGE)) { return actor; - return NULL; } } @@ -508,10 +495,10 @@ idEntity* idAI::Native_HeardSound(int ignore_team) { /* ===================== -idAI::Native_SetEnemy +idAI::SetEnemy ===================== */ -void idAI::Native_SetEnemy(idEntity* ent) { +void idAI::SetEnemy(idEntity* ent) { if (!ent) { ClearEnemy(); } @@ -525,19 +512,10 @@ void idAI::Native_SetEnemy(idEntity* ent) { /* ===================== -idAI::Native_ClearEnemy +idAI::MuzzleFlash ===================== */ -void idAI::Native_ClearEnemy(void) { - ClearEnemy(); -} - -/* -===================== -idAI::Native_MuzzleFlash -===================== -*/ -void idAI::Native_MuzzleFlash(const char* jointname) { +void idAI::MuzzleFlash(const char* jointname) { idVec3 muzzle; idMat3 axis; @@ -547,10 +525,10 @@ void idAI::Native_MuzzleFlash(const char* jointname) { /* ===================== -idAI::Native_CreateMissile +idAI::CreateMissile ===================== */ -idEntity* idAI::Native_CreateMissile(const char* jointname) { +idEntity* idAI::CreateMissile(const char* jointname) { idVec3 muzzle; idMat3 axis; @@ -574,10 +552,10 @@ idEntity* idAI::Native_CreateMissile(const char* jointname) { /* ===================== -idAI::Native_AttackMissile +idAI::AttackMissile ===================== */ -idEntity* idAI::Native_AttackMissile(const char* jointname) { +idEntity* idAI::AttackMissile(const char* jointname) { idProjectile* proj; proj = LaunchProjectile(jointname, enemy.GetEntity(), true); @@ -586,10 +564,10 @@ idEntity* idAI::Native_AttackMissile(const char* jointname) { /* ===================== -idAI::Native_FireMissileAtTarget +idAI::FireMissileAtTarget ===================== */ -idEntity* idAI::Native_FireMissileAtTarget(const char* jointname, const char* targetname) { +idEntity* idAI::FireMissileAtTarget(const char* jointname, const char* targetname) { idEntity* aent; idProjectile* proj; @@ -604,10 +582,10 @@ idEntity* idAI::Native_FireMissileAtTarget(const char* jointname, const char* ta /* ===================== -idAI::Native_LaunchMissile +idAI::LaunchMissile ===================== */ -idEntity* idAI::Native_LaunchMissile(const idVec3& org, const idAngles& ang) { +idEntity* idAI::LaunchMissile(const idVec3& org, const idAngles& ang) { idVec3 start; trace_t tr; idBounds projBounds; @@ -618,7 +596,6 @@ idEntity* idAI::Native_LaunchMissile(const idVec3& org, const idAngles& ang) { if (!projectileDef) { gameLocal.Warning("%s (%s) doesn't have a projectile specified", name.c_str(), GetEntityDefName()); return NULL; - return NULL; } axis = ang.ToMat3(); @@ -662,31 +639,19 @@ idEntity* idAI::Native_LaunchMissile(const idVec3& org, const idAngles& ang) { /* ===================== -idAI::Native_AttackMelee +idAI::DirectDamage ===================== */ -int idAI::Native_AttackMelee(const char* meleeDefName) { - bool hit; - - hit = AttackMelee(meleeDefName); - return hit; -} - -/* -===================== -idAI::Native_DirectDamage -===================== -*/ -void idAI::Native_DirectDamage(idEntity* damageTarget, const char* damageDefName) { +void idAI::DirectDamage(idEntity* damageTarget, const char* damageDefName) { DirectDamage(damageDefName, damageTarget); } /* ===================== -idAI::Native_RadiusDamageFromJoint +idAI::RadiusDamageFromJoint ===================== */ -void idAI::Native_RadiusDamageFromJoint(const char* jointname, const char* damageDefName) { +void idAI::RadiusDamageFromJoint(const char* jointname, const char* damageDefName) { jointHandle_t joint; idVec3 org; idMat3 axis; @@ -707,10 +672,10 @@ void idAI::Native_RadiusDamageFromJoint(const char* jointname, const char* damag /* ===================== -idAI::Native_RandomPath +idAI::RandomPath ===================== */ -idEntity* idAI::Native_RandomPath(void) { +idEntity* idAI::RandomPath(void) { idPathCorner* path; path = idPathCorner::RandomPath(this, NULL); @@ -719,28 +684,10 @@ idEntity* idAI::Native_RandomPath(void) { /* ===================== -idAI::Native_BeginAttack +idAI::MeleeAttackToJoint ===================== */ -void idAI::Native_BeginAttack(const char* name) { - BeginAttack(name); -} - -/* -===================== -idAI::Native_EndAttack -===================== -*/ -void idAI::Native_EndAttack(void) { - EndAttack(); -} - -/* -===================== -idAI::Native_MeleeAttackToJoint -===================== -*/ -int idAI::Native_MeleeAttackToJoint(const char* jointname, const char* meleeDefName) { +int idAI::MeleeAttackToJoint(const char* jointname, const char* meleeDefName) { jointHandle_t joint; idVec3 start; idVec3 end; @@ -766,7 +713,6 @@ int idAI::Native_MeleeAttackToJoint(const char* jointname, const char* meleeDefN if (hitEnt && hitEnt->IsType(idActor::Type)) { DirectDamage(meleeDefName, hitEnt); return true; - return false; } } @@ -775,10 +721,10 @@ int idAI::Native_MeleeAttackToJoint(const char* jointname, const char* meleeDefN /* ===================== -idAI::Native_CanBecomeSolid +idAI::CanBecomeSolid ===================== */ -float idAI::Native_CanBecomeSolid(void) { +float idAI::CanBecomeSolid(void) { int i; int num; idEntity* hit; @@ -801,7 +747,6 @@ float idAI::Native_CanBecomeSolid(void) { if (physicsObj.ClipContents(cm)) { return false; - return 0.0f; } } @@ -810,10 +755,10 @@ float idAI::Native_CanBecomeSolid(void) { /* ===================== -idAI::Native_BecomeSolid +idAI::BecomeSolid ===================== */ -void idAI::Native_BecomeSolid(void) { +void idAI::BecomeSolid(void) { physicsObj.EnableClip(); if (spawnArgs.GetBool("big_monster")) { physicsObj.SetContents(0); @@ -830,10 +775,10 @@ void idAI::Native_BecomeSolid(void) { /* ===================== -idAI::Native_BecomeNonSolid +idAI::BecomeNonSolid ===================== */ -void idAI::Native_BecomeNonSolid(void) { +void idAI::BecomeNonSolid(void) { fl.takedamage = false; physicsObj.SetContents(0); physicsObj.GetClipModel()->Unlink(); @@ -841,10 +786,10 @@ void idAI::Native_BecomeNonSolid(void) { /* ===================== -idAI::Native_BecomeRagdoll +idAI::BecomeRagdoll ===================== */ -int idAI::Native_BecomeRagdoll(void) { +int idAI::BecomeRagdoll(void) { bool result; result = StartRagdoll(); @@ -853,11 +798,11 @@ int idAI::Native_BecomeRagdoll(void) { /* ===================== -idAI::Native_StopRagdoll +idAI::StopRagdoll ===================== */ -void idAI::Native_StopRagdoll(void) { - StopRagdoll(); +void idAI::StopRagdoll(void) { + idActor::StopRagdoll(); // set back the monster physics SetPhysics(&physicsObj); @@ -865,10 +810,10 @@ void idAI::Native_StopRagdoll(void) { /* ===================== -idAI::Native_SetHealth +idAI::SetHealth ===================== */ -void idAI::Native_SetHealth(float newHealth) { +void idAI::SetHealth(float newHealth) { health = newHealth; fl.takedamage = true; if (health > 0) { @@ -881,64 +826,64 @@ void idAI::Native_SetHealth(float newHealth) { /* ===================== -idAI::Native_GetHealth +idAI::GetHealth ===================== */ -float idAI::Native_GetHealth(void) { +float idAI::GetHealth(void) { return health; } /* ===================== -idAI::Native_AllowDamage +idAI::AllowDamage ===================== */ -void idAI::Native_AllowDamage(void) { +void idAI::AllowDamage(void) { fl.takedamage = true; } /* ===================== -idAI::Native_IgnoreDamage +idAI::IgnoreDamage ===================== */ -void idAI::Native_IgnoreDamage(void) { +void idAI::IgnoreDamage(void) { fl.takedamage = false; } /* ===================== -idAI::Native_GetCurrentYaw +idAI::GetCurrentYaw ===================== */ -float idAI::Native_GetCurrentYaw(void) { +float idAI::GetCurrentYaw(void) { return current_yaw; } /* ===================== -idAI::Native_TurnTo +idAI::TurnTo ===================== */ -void idAI::Native_TurnTo(float angle) { +void idAI::TurnTo(float angle) { TurnToward(angle); } /* ===================== -idAI::Native_TurnToPos +idAI::TurnToPos ===================== */ -void idAI::Native_TurnToPos(const idVec3& pos) { +void idAI::TurnToPos(const idVec3& pos) { TurnToward(pos); } /* ===================== -idAI::Native_TurnToEntity +idAI::TurnToEntity ===================== */ -void idAI::Native_TurnToEntity(idEntity* ent) { +void idAI::TurnToEntity(idEntity* ent) { if (ent) { TurnToward(ent->GetPhysics()->GetOrigin()); } @@ -946,28 +891,28 @@ void idAI::Native_TurnToEntity(idEntity* ent) { /* ===================== -idAI::Native_MoveStatus +idAI::MoveStatus ===================== */ -int idAI::Native_MoveStatus(void) { +int idAI::MoveStatus(void) { return move.moveStatus; } /* ===================== -idAI::Native_StopMove +idAI::StopMove ===================== */ -void idAI::Native_StopMove(void) { +void idAI::StopMove(void) { StopMove(MOVE_STATUS_DONE); } /* ===================== -idAI::Native_MoveToCover +idAI::MoveToCover ===================== */ -void idAI::Native_MoveToCover(void) { +void idAI::MoveToCover(void) { idActor* enemyEnt = enemy.GetEntity(); StopMove(MOVE_STATUS_DEST_NOT_FOUND); @@ -978,128 +923,28 @@ void idAI::Native_MoveToCover(void) { /* ===================== -idAI::Native_MoveToEnemy +idAI::SlideTo ===================== */ -void idAI::Native_MoveToEnemy(void) { - StopMove(MOVE_STATUS_DEST_NOT_FOUND); - if (!enemy.GetEntity() || !MoveToEnemy()) { - return; - } -} - -/* -===================== -idAI::Native_MoveToEnemyHeight -===================== -*/ -void idAI::Native_MoveToEnemyHeight(void) { - StopMove(MOVE_STATUS_DEST_NOT_FOUND); - MoveToEnemyHeight(); -} - -/* -===================== -idAI::Native_MoveOutOfRange -===================== -*/ -void idAI::Native_MoveOutOfRange(idEntity* entity, float range) { - StopMove(MOVE_STATUS_DEST_NOT_FOUND); - MoveOutOfRange(entity, range); -} - -/* -===================== -idAI::Native_MoveToAttackPosition -===================== -*/ -void idAI::Native_MoveToAttackPosition(idEntity* entity, const char* attack_anim) { - int anim; - - StopMove(MOVE_STATUS_DEST_NOT_FOUND); - - anim = GetAnim(ANIMCHANNEL_LEGS, attack_anim); - if (!anim) { - gameLocal.Error("Unknown anim '%s'", attack_anim); - } - - MoveToAttackPosition(entity, anim); -} - -/* -===================== -idAI::Native_MoveToEntity -===================== -*/ -void idAI::Native_MoveToEntity(idEntity* ent) { - StopMove(MOVE_STATUS_DEST_NOT_FOUND); - if (ent) { - MoveToEntity(ent); - } -} - -/* -===================== -idAI::Native_MoveToPosition -===================== -*/ -void idAI::Native_MoveToPosition(const idVec3& pos) { - StopMove(MOVE_STATUS_DONE); - MoveToPosition(pos); -} - -/* -===================== -idAI::Native_SlideTo -===================== -*/ -void idAI::Native_SlideTo(const idVec3& pos, float time) { +void idAI::SlideTo(const idVec3& pos, float time) { SlideToPosition(pos, time); } /* ===================== -idAI::Native_Wander +idAI::Wander ===================== */ -void idAI::Native_Wander(void) { +void idAI::Wander(void) { WanderAround(); } /* ===================== -idAI::Native_FacingIdeal +idAI::GetCombatNode ===================== */ -int idAI::Native_FacingIdeal(void) { - bool facing = FacingIdeal(); - return facing; -} - -/* -===================== -idAI::Native_FaceEnemy -===================== -*/ -void idAI::Native_FaceEnemy(void) { - FaceEnemy(); -} - -/* -===================== -idAI::Native_FaceEntity -===================== -*/ -void idAI::Native_FaceEntity(idEntity* ent) { - FaceEntity(ent); -} - -/* -===================== -idAI::Native_GetCombatNode -===================== -*/ -idEntity* idAI::Native_GetCombatNode(void) { +idEntity* idAI::GetCombatNode(void) { int i; float dist; idEntity* targetEnt; @@ -1111,14 +956,12 @@ idEntity* idAI::Native_GetCombatNode(void) { if (!targets.Num()) { // no combat nodes return NULL; - return NULL; } if (!enemyEnt || !EnemyPositionValid()) { // don't return a combat node if we don't have an enemy or // if we can see he's not in the last place we saw him return NULL; - return NULL; } // find the closest attack node that can see our enemy and is closer than our enemy @@ -1147,10 +990,10 @@ idEntity* idAI::Native_GetCombatNode(void) { /* ===================== -idAI::Native_EnemyInCombatCone +idAI::EnemyInCombatCone ===================== */ -int idAI::Native_EnemyInCombatCone(idEntity* ent, int use_current_enemy_location) { +int idAI::EnemyInCombatCone(idEntity* ent, int use_current_enemy_location) { idCombatNode* node; bool result; idActor* enemyEnt = enemy.GetEntity(); @@ -1158,19 +1001,16 @@ int idAI::Native_EnemyInCombatCone(idEntity* ent, int use_current_enemy_location if (!targets.Num()) { // no combat nodes return false; - return false; } if (!enemyEnt) { // have to have an enemy return false; - return false; } if (!ent || !ent->IsType(idCombatNode::Type)) { // not a combat node return false; - return false; } node = static_cast(ent); @@ -1187,10 +1027,10 @@ int idAI::Native_EnemyInCombatCone(idEntity* ent, int use_current_enemy_location /* ===================== -idAI::Native_GetJumpVelocity +idAI::GetJumpVelocity ===================== */ -idVec3 idAI::Native_GetJumpVelocity(const idVec3& pos, float speed, float max_height) { +idVec3 idAI::GetJumpVelocity(const idVec3& pos, float speed, float max_height) { idVec3 start; idVec3 end; idVec3 dir; @@ -1200,7 +1040,6 @@ idVec3 idAI::Native_GetJumpVelocity(const idVec3& pos, float speed, float max_he if (!enemyEnt) { return vec3_zero; - return vec3_zero; } if (speed <= 0.0f) { @@ -1227,10 +1066,10 @@ idVec3 idAI::Native_GetJumpVelocity(const idVec3& pos, float speed, float max_he /* ===================== -idAI::Native_EntityInAttackCone +idAI::EntityInAttackCone ===================== */ -int idAI::Native_EntityInAttackCone(idEntity* ent) { +int idAI::EntityInAttackCone(idEntity* ent) { float attack_cone; idVec3 delta; float yaw; @@ -1238,7 +1077,6 @@ int idAI::Native_EntityInAttackCone(idEntity* ent) { if (!ent) { return false; - return false; } delta = ent->GetPhysics()->GetOrigin() - GetEyePosition(); @@ -1264,13 +1102,12 @@ int idAI::Native_EntityInAttackCone(idEntity* ent) { /* ===================== -idAI::Native_CanSeeEntity +idAI::CanSeeEntity ===================== */ -int idAI::Native_CanSeeEntity(idEntity* ent) { +int idAI::CanSeeEntity(idEntity* ent) { if (!ent) { return false; - return false; } bool cansee = CanSee(ent, false); @@ -1279,10 +1116,10 @@ int idAI::Native_CanSeeEntity(idEntity* ent) { /* ===================== -idAI::Native_SetTalkTarget +idAI::SetTalkTarget ===================== */ -void idAI::Native_SetTalkTarget(idEntity* target) { +void idAI::SetTalkTarget(idEntity* target) { if (target && !target->IsType(idActor::Type)) { gameLocal.Error("Cannot set talk target to '%s'. Not a character or player.", target->GetName()); } @@ -1297,19 +1134,19 @@ void idAI::Native_SetTalkTarget(idEntity* target) { /* ===================== -idAI::Native_GetTalkTarget +idAI::GetTalkTarget ===================== */ -idEntity* idAI::Native_GetTalkTarget(void) { +idEntity* idAI::GetTalkTarget(void) { return talkTarget.GetEntity(); } /* ===================== -idAI::Native_SetTalkState +idAI::SetTalkState ===================== */ -void idAI::Native_SetTalkState(int state) { +void idAI::SetTalkState(int state) { if ((state < 0) || (state >= NUM_TALK_STATES)) { gameLocal.Error("Invalid talk state (%d)", state); } @@ -1319,10 +1156,10 @@ void idAI::Native_SetTalkState(int state) { /* ===================== -idAI::Native_EnemyRange +idAI::EnemyRange ===================== */ -float idAI::Native_EnemyRange(void) { +float idAI::EnemyRange(void) { float dist; idActor* enemyEnt = enemy.GetEntity(); @@ -1339,10 +1176,10 @@ float idAI::Native_EnemyRange(void) { /* ===================== -idAI::Native_EnemyRange2D +idAI::EnemyRange2D ===================== */ -float idAI::Native_EnemyRange2D(void) { +float idAI::EnemyRange2D(void) { float dist; idActor* enemyEnt = enemy.GetEntity(); @@ -1359,44 +1196,34 @@ float idAI::Native_EnemyRange2D(void) { /* ===================== -idAI::Native_GetEnemy +idAI::GetEnemyPos ===================== */ -idEntity* idAI::Native_GetEnemy(void) { - return enemy.GetEntity(); -} - -/* -===================== -idAI::Native_GetEnemyPos -===================== -*/ -idVec3 idAI::Native_GetEnemyPos(void) { +idVec3 idAI::GetEnemyPos(void) { return lastVisibleEnemyPos; } /* ===================== -idAI::Native_GetEnemyEyePos +idAI::GetEnemyEyePos ===================== */ -idVec3 idAI::Native_GetEnemyEyePos(void) { +idVec3 idAI::GetEnemyEyePos(void) { return lastVisibleEnemyPos + lastVisibleEnemyEyeOffset; } /* ===================== -idAI::Native_PredictEnemyPos +idAI::PredictEnemyPos ===================== */ -idVec3 idAI::Native_PredictEnemyPos(float time) { +idVec3 idAI::PredictEnemyPos(float time) { predictedPath_t path; idActor* enemyEnt = enemy.GetEntity(); // if no enemy set if (!enemyEnt) { return physicsObj.GetOrigin(); - return vec3_zero; } // predict the enemy movement @@ -1407,23 +1234,21 @@ idVec3 idAI::Native_PredictEnemyPos(float time) { /* ===================== -idAI::Native_CanHitEnemy +idAI::CanHitEnemy ===================== */ -int idAI::Native_CanHitEnemy(void) { +int idAI::CanHitEnemy(void) { trace_t tr; idEntity* hit; idActor* enemyEnt = enemy.GetEntity(); if (!AI_ENEMY_VISIBLE || !enemyEnt) { return false; - return false; } // don't check twice per frame if (gameLocal.time == lastHitCheckTime) { return lastHitCheckResult; - return false; } lastHitCheckTime = gameLocal.time; @@ -1454,10 +1279,10 @@ int idAI::Native_CanHitEnemy(void) { /* ===================== -idAI::Native_CanHitEnemyFromAnim +idAI::CanHitEnemyFromAnim ===================== */ -int idAI::Native_CanHitEnemyFromAnim(const char* animname) { +int idAI::CanHitEnemyFromAnim(const char* animname) { int anim; idVec3 dir; idVec3 local_dir; @@ -1470,19 +1295,16 @@ int idAI::Native_CanHitEnemyFromAnim(const char* animname) { idActor* enemyEnt = enemy.GetEntity(); if (!AI_ENEMY_VISIBLE || !enemyEnt) { return false; - return false; } anim = GetAnim(ANIMCHANNEL_LEGS, animname); if (!anim) { return false; - return false; } // just do a ray test if close enough if (enemyEnt->GetPhysics()->GetAbsBounds().IntersectsBounds(physicsObj.GetAbsBounds().Expand(16.0f))) { - return Native_CanHitEnemy(); - return false; + return CanHitEnemy(); } // calculate the world transform of the launch position @@ -1529,10 +1351,10 @@ int idAI::Native_CanHitEnemyFromAnim(const char* animname) { /* ===================== -idAI::Native_CanHitEnemyFromJoint +idAI::CanHitEnemyFromJoint ===================== */ -int idAI::Native_CanHitEnemyFromJoint(const char* jointname) { +int idAI::CanHitEnemyFromJoint(const char* jointname) { trace_t tr; idVec3 muzzle; idMat3 axis; @@ -1542,13 +1364,11 @@ int idAI::Native_CanHitEnemyFromJoint(const char* jointname) { idActor* enemyEnt = enemy.GetEntity(); if (!AI_ENEMY_VISIBLE || !enemyEnt) { return false; - return false; } // don't check twice per frame if (gameLocal.time == lastHitCheckTime) { return lastHitCheckResult; - return false; } lastHitCheckTime = gameLocal.time; @@ -1600,22 +1420,10 @@ int idAI::Native_CanHitEnemyFromJoint(const char* jointname) { /* ===================== -idAI::Native_EnemyPositionValid +idAI::ChargeAttack ===================== */ -int idAI::Native_EnemyPositionValid(void) { - bool result; - - result = EnemyPositionValid(); - return result; -} - -/* -===================== -idAI::Native_ChargeAttack -===================== -*/ -void idAI::Native_ChargeAttack(const char* damageDef) { +void idAI::ChargeAttack(const char* damageDef) { idActor* enemyEnt = enemy.GetEntity(); StopMove(MOVE_STATUS_DEST_NOT_FOUND); @@ -1639,10 +1447,10 @@ void idAI::Native_ChargeAttack(const char* damageDef) { /* ===================== -idAI::Native_TestChargeAttack +idAI::TestChargeAttack ===================== */ -float idAI::Native_TestChargeAttack(void) { +float idAI::TestChargeAttack(void) { trace_t trace; idActor* enemyEnt = enemy.GetEntity(); predictedPath_t path; @@ -1650,7 +1458,6 @@ float idAI::Native_TestChargeAttack(void) { if (!enemyEnt) { return 0.0f; - return 0.0f; } if (move.moveType == MOVETYPE_FLY) { @@ -1681,10 +1488,10 @@ float idAI::Native_TestChargeAttack(void) { /* ===================== -idAI::Native_TestAnimMoveTowardEnemy +idAI::TestAnimMoveTowardEnemy ===================== */ -int idAI::Native_TestAnimMoveTowardEnemy(const char* animname) { +int idAI::TestAnimMoveTowardEnemy(const char* animname) { int anim; predictedPath_t path; idVec3 moveVec; @@ -1695,14 +1502,12 @@ int idAI::Native_TestAnimMoveTowardEnemy(const char* animname) { enemyEnt = enemy.GetEntity(); if (!enemyEnt) { return false; - return false; } anim = GetAnim(ANIMCHANNEL_LEGS, animname); if (!anim) { gameLocal.DWarning("missing '%s' animation on '%s' (%s)", animname, name.c_str(), GetEntityDefName()); return false; - return false; } delta = enemyEnt->GetPhysics()->GetOrigin() - physicsObj.GetOrigin(); @@ -1721,10 +1526,10 @@ int idAI::Native_TestAnimMoveTowardEnemy(const char* animname) { /* ===================== -idAI::Native_TestAnimMove +idAI::TestAnimMove ===================== */ -int idAI::Native_TestAnimMove(const char* animname) { +int idAI::TestAnimMove(const char* animname) { int anim; predictedPath_t path; idVec3 moveVec; @@ -1733,7 +1538,6 @@ int idAI::Native_TestAnimMove(const char* animname) { if (!anim) { gameLocal.DWarning("missing '%s' animation on '%s' (%s)", animname, name.c_str(), GetEntityDefName()); return false; - return false; } moveVec = animator.TotalMovementDelta(anim) * idAngles(0.0f, ideal_yaw, 0.0f).ToMat3() * physicsObj.GetGravityAxis(); @@ -1749,10 +1553,10 @@ int idAI::Native_TestAnimMove(const char* animname) { /* ===================== -idAI::Native_TestMoveToPosition +idAI::TestMoveToPosition ===================== */ -int idAI::Native_TestMoveToPosition(const idVec3& position) { +int idAI::TestMoveToPosition(const idVec3& position) { predictedPath_t path; idAI::PredictPath(this, aas, physicsObj.GetOrigin(), position - physicsObj.GetOrigin(), 1000, 1000, (move.moveType == MOVETYPE_FLY) ? SE_BLOCKED : (SE_ENTER_OBSTACLE | SE_BLOCKED | SE_ENTER_LEDGE_AREA), path); @@ -1770,20 +1574,20 @@ int idAI::Native_TestMoveToPosition(const idVec3& position) { /* ===================== -idAI::Native_TestMeleeAttack +idAI::TestMeleeAttack ===================== */ -int idAI::Native_TestMeleeAttack(void) { +int idAI::TestMeleeAttack(void) { bool result = TestMelee(); return result; } /* ===================== -idAI::Native_TestAnimAttack +idAI::TestAnimAttack ===================== */ -int idAI::Native_TestAnimAttack(const char* animname) { +int idAI::TestAnimAttack(const char* animname) { int anim; predictedPath_t path; @@ -1791,7 +1595,6 @@ int idAI::Native_TestAnimAttack(const char* animname) { if (!anim) { gameLocal.DWarning("missing '%s' animation on '%s' (%s)", animname, name.c_str(), GetEntityDefName()); return false; - return false; } idAI::PredictPath(this, aas, physicsObj.GetOrigin(), animator.TotalMovementDelta(anim), 1000, 1000, (move.moveType == MOVETYPE_FLY) ? SE_BLOCKED : (SE_ENTER_OBSTACLE | SE_BLOCKED | SE_ENTER_LEDGE_AREA), path); @@ -1801,20 +1604,20 @@ int idAI::Native_TestAnimAttack(const char* animname) { /* ===================== -idAI::Native_PreBurn +idAI::PreBurn ===================== */ -void idAI::Native_PreBurn(void) { +void idAI::PreBurn(void) { // for now this just turns shadows off renderEntity.noShadow = true; } /* ===================== -idAI::Native_Burn +idAI::Burn ===================== */ -void idAI::Native_Burn(void) { +void idAI::Burn(void) { renderEntity.shaderParms[SHADERPARM_TIME_OF_DEATH] = gameLocal.time * 0.001f; SpawnParticles("smoke_burnParticleSystem"); UpdateVisuals(); @@ -1822,10 +1625,10 @@ void idAI::Native_Burn(void) { /* ===================== -idAI::Native_ClearBurn +idAI::ClearBurn ===================== */ -void idAI::Native_ClearBurn(void) { +void idAI::ClearBurn(void) { renderEntity.noShadow = spawnArgs.GetBool("noshadows"); renderEntity.shaderParms[SHADERPARM_TIME_OF_DEATH] = 0.0f; UpdateVisuals(); @@ -1833,10 +1636,10 @@ void idAI::Native_ClearBurn(void) { /* ===================== -idAI::Native_SetSmokeVisibility +idAI::SetSmokeVisibility ===================== */ -void idAI::Native_SetSmokeVisibility(int num, int on) { +void idAI::SetSmokeVisibility(int num, int on) { int i; int time; @@ -1867,28 +1670,28 @@ void idAI::Native_SetSmokeVisibility(int num, int on) { /* ===================== -idAI::Native_NumSmokeEmitters +idAI::NumSmokeEmitters ===================== */ -int idAI::Native_NumSmokeEmitters(void) { +int idAI::NumSmokeEmitters(void) { return particles.Num(); } /* ===================== -idAI::Native_StopThinking +idAI::StopThinking ===================== */ -void idAI::Native_StopThinking(void) { +void idAI::StopThinking(void) { BecomeInactive(TH_THINK); } /* ===================== -idAI::Native_GetTurnDelta +idAI::GetTurnDelta ===================== */ -float idAI::Native_GetTurnDelta(void) { +float idAI::GetTurnDelta(void) { float amount; if (turnRate) { @@ -1902,19 +1705,19 @@ float idAI::Native_GetTurnDelta(void) { /* ===================== -idAI::Native_GetMoveType +idAI::GetMoveType ===================== */ -int idAI::Native_GetMoveType(void) { +int idAI::GetMoveType(void) { return move.moveType; } /* ===================== -idAI::Native_SetMoveType +idAI::SetMoveType ===================== */ -void idAI::Native_SetMoveType(int moveType) { +void idAI::SetMoveType(int moveType) { if ((moveType < 0) || (moveType >= NUM_MOVETYPES)) { gameLocal.Error("Invalid movetype %d", moveType); } @@ -1930,19 +1733,19 @@ void idAI::Native_SetMoveType(int moveType) { /* ===================== -idAI::Native_SaveMove +idAI::SaveMove ===================== */ -void idAI::Native_SaveMove(void) { +void idAI::SaveMove(void) { savedMove = move; } /* ===================== -idAI::Native_RestoreMove +idAI::RestoreMove ===================== */ -void idAI::Native_RestoreMove(void) { +void idAI::RestoreMove(void) { idVec3 goalPos; idVec3 dest; @@ -2007,84 +1810,84 @@ void idAI::Native_RestoreMove(void) { /* ===================== -idAI::Native_AllowMovement +idAI::AllowMovement ===================== */ -void idAI::Native_AllowMovement(float flag) { +void idAI::AllowMovement(float flag) { allowMove = (flag != 0.0f); } /* ===================== -idAI::Native_JumpFrame +idAI::JumpFrame ===================== */ -void idAI::Native_JumpFrame(void) { +void idAI::JumpFrame(void) { AI_JUMP = true; } /* ===================== -idAI::Native_EnableClip +idAI::EnableClip ===================== */ -void idAI::Native_EnableClip(void) { +void idAI::EnableClip(void) { physicsObj.SetClipMask(MASK_MONSTERSOLID); disableGravity = false; } /* ===================== -idAI::Native_DisableClip +idAI::DisableClip ===================== */ -void idAI::Native_DisableClip(void) { +void idAI::DisableClip(void) { physicsObj.SetClipMask(0); disableGravity = true; } /* ===================== -idAI::Native_EnableGravity +idAI::EnableGravity ===================== */ -void idAI::Native_EnableGravity(void) { +void idAI::EnableGravity(void) { disableGravity = false; } /* ===================== -idAI::Native_DisableGravity +idAI::DisableGravity ===================== */ -void idAI::Native_DisableGravity(void) { +void idAI::DisableGravity(void) { disableGravity = true; } /* ===================== -idAI::Native_EnableAFPush +idAI::EnableAFPush ===================== */ -void idAI::Native_EnableAFPush(void) { +void idAI::EnableAFPush(void) { af_push_moveables = true; } /* ===================== -idAI::Native_DisableAFPush +idAI::DisableAFPush ===================== */ -void idAI::Native_DisableAFPush(void) { +void idAI::DisableAFPush(void) { af_push_moveables = false; } /* ===================== -idAI::Native_SetFlySpeed +idAI::SetFlySpeed ===================== */ -void idAI::Native_SetFlySpeed(float speed) { +void idAI::SetFlySpeed(float speed) { if (move.speed == fly_speed) { move.speed = speed; } @@ -2093,28 +1896,28 @@ void idAI::Native_SetFlySpeed(float speed) { /* ===================== -idAI::Native_SetFlyOffset +idAI::SetFlyOffset ===================== */ -void idAI::Native_SetFlyOffset(int offset) { +void idAI::SetFlyOffset(int offset) { fly_offset = offset; } /* ===================== -idAI::Native_ClearFlyOffset +idAI::ClearFlyOffset ===================== */ -void idAI::Native_ClearFlyOffset(void) { +void idAI::ClearFlyOffset(void) { spawnArgs.GetInt("fly_offset", "0", fly_offset); } /* ===================== -idAI::Native_GetClosestHiddenTarget +idAI::GetClosestHiddenTarget ===================== */ -idEntity* idAI::Native_GetClosestHiddenTarget(const char* type) { +idEntity* idAI::GetClosestHiddenTarget(const char* type) { int i; idEntity* ent; idEntity* bestEnt; @@ -2126,7 +1929,6 @@ idEntity* idAI::Native_GetClosestHiddenTarget(const char* type) { if (!enemyEnt) { // no enemy to hide from return NULL; - return NULL; } if (targets.Num() == 1) { @@ -2134,11 +1936,9 @@ idEntity* idAI::Native_GetClosestHiddenTarget(const char* type) { if (ent && idStr::Cmp(ent->GetEntityDefName(), type) == 0) { if (!EntityCanSeePos(enemyEnt, lastVisibleEnemyPos, ent->GetPhysics()->GetOrigin())) { return ent; - return NULL; } } return NULL; - return NULL; } bestEnt = NULL; @@ -2161,10 +1961,10 @@ idEntity* idAI::Native_GetClosestHiddenTarget(const char* type) { /* ===================== -idAI::Native_GetRandomTarget +idAI::GetRandomTarget ===================== */ -idEntity* idAI::Native_GetRandomTarget(const char* type) { +idEntity* idAI::GetRandomTarget(const char* type) { int i; int num; int which; @@ -2184,7 +1984,6 @@ idEntity* idAI::Native_GetRandomTarget(const char* type) { if (!num) { return NULL; - return NULL; } which = gameLocal.random.RandomInt(num); @@ -2193,10 +1992,10 @@ idEntity* idAI::Native_GetRandomTarget(const char* type) { /* ===================== -idAI::Native_TravelDistanceToPoint +idAI::TravelDistanceToPoint ===================== */ -float idAI::Native_TravelDistanceToPoint(const idVec3& pos) { +float idAI::TravelDistanceToPoint(const idVec3& pos) { float time; time = TravelDistance(physicsObj.GetOrigin(), pos); @@ -2205,10 +2004,10 @@ float idAI::Native_TravelDistanceToPoint(const idVec3& pos) { /* ===================== -idAI::Native_TravelDistanceToEntity +idAI::TravelDistanceToEntity ===================== */ -float idAI::Native_TravelDistanceToEntity(idEntity* ent) { +float idAI::TravelDistanceToEntity(idEntity* ent) { float time; time = TravelDistance(physicsObj.GetOrigin(), ent->GetPhysics()->GetOrigin()); @@ -2217,10 +2016,10 @@ float idAI::Native_TravelDistanceToEntity(idEntity* ent) { /* ===================== -idAI::Native_TravelDistanceBetweenPoints +idAI::TravelDistanceBetweenPoints ===================== */ -float idAI::Native_TravelDistanceBetweenPoints(const idVec3& source, const idVec3& dest) { +float idAI::TravelDistanceBetweenPoints(const idVec3& source, const idVec3& dest) { float time; time = TravelDistance(source, dest); @@ -2229,10 +2028,10 @@ float idAI::Native_TravelDistanceBetweenPoints(const idVec3& source, const idVec /* ===================== -idAI::Native_TravelDistanceBetweenEntities +idAI::TravelDistanceBetweenEntities ===================== */ -float idAI::Native_TravelDistanceBetweenEntities(idEntity* source, idEntity* dest) { +float idAI::TravelDistanceBetweenEntities(idEntity* source, idEntity* dest) { float time; assert(source); @@ -2243,10 +2042,10 @@ float idAI::Native_TravelDistanceBetweenEntities(idEntity* source, idEntity* des /* ===================== -idAI::Native_LookAtEntity +idAI::LookAtEntity ===================== */ -void idAI::Native_LookAtEntity(idEntity* ent, float duration) { +void idAI::LookAtEntity(idEntity* ent, float duration) { if (ent == this) { ent = NULL; } @@ -2263,10 +2062,10 @@ void idAI::Native_LookAtEntity(idEntity* ent, float duration) { /* ===================== -idAI::Native_LookAtEnemy +idAI::LookAtEnemy ===================== */ -void idAI::Native_LookAtEnemy(float duration) { +void idAI::LookAtEnemy(float duration) { idActor* enemyEnt; enemyEnt = enemy.GetEntity(); @@ -2282,19 +2081,19 @@ void idAI::Native_LookAtEnemy(float duration) { /* ===================== -idAI::Native_SetJointMod +idAI::SetJointMod ===================== */ -void idAI::Native_SetJointMod(int allow) { +void idAI::SetJointMod(int allow) { allowJointMod = (allow != 0); } /* ===================== -idAI::Native_ThrowMoveable +idAI::ThrowMoveable ===================== */ -void idAI::Native_ThrowMoveable(void) { +void idAI::ThrowMoveable(void) { idEntity* ent; idEntity* moveable = NULL; @@ -2312,10 +2111,10 @@ void idAI::Native_ThrowMoveable(void) { /* ===================== -idAI::Native_ThrowAF +idAI::ThrowAF ===================== */ -void idAI::Native_ThrowAF(void) { +void idAI::ThrowAF(void) { idEntity* ent; idEntity* af = NULL; @@ -2333,29 +2132,29 @@ void idAI::Native_ThrowAF(void) { /* ===================== -idAI::Native_SetAngles +idAI::SetAngles ===================== */ -void idAI::Native_SetAngles(idAngles const& ang) { +void idAI::SetAngles(idAngles const& ang) { current_yaw = ang.yaw; viewAxis = idAngles(0, current_yaw, 0).ToMat3(); } /* ===================== -idAI::Native_GetAngles +idAI::GetAngles ===================== */ -idVec3 idAI::Native_GetAngles(void) { +idVec3 idAI::GetAngles(void) { return idVec3(0.0f, current_yaw, 0.0f); } /* ===================== -idAI::Native_RealKill +idAI::RealKill ===================== */ -void idAI::Native_RealKill(void) { +void idAI::RealKill(void) { health = 0; if (af.IsLoaded()) { @@ -2371,28 +2170,28 @@ void idAI::Native_RealKill(void) { /* ===================== -idAI::Native_Kill +idAI::Kill ===================== */ -void idAI::Native_Kill(void) { +void idAI::Kill(void) { PostEventMS(&AI_RealKill, 0); } /* ===================== -idAI::Native_WakeOnFlashlight +idAI::WakeOnFlashlight ===================== */ -void idAI::Native_WakeOnFlashlight(int enable) { +void idAI::WakeOnFlashlight(int enable) { wakeOnFlashlight = (enable != 0); } /* ===================== -idAI::Native_LocateEnemy +idAI::LocateEnemy ===================== */ -void idAI::Native_LocateEnemy(void) { +void idAI::LocateEnemy(void) { idActor* enemyEnt; int areaNum; @@ -2408,10 +2207,10 @@ void idAI::Native_LocateEnemy(void) { /* ===================== -idAI::Native_KickObstacles +idAI::KickObstacles ===================== */ -void idAI::Native_KickObstacles(idEntity* kickEnt, float force) { +void idAI::KickObstacles(idEntity* kickEnt, float force) { idVec3 dir; idEntity* obEnt; @@ -2434,19 +2233,19 @@ void idAI::Native_KickObstacles(idEntity* kickEnt, float force) { /* ===================== -idAI::Native_GetObstacle +idAI::GetObstacle ===================== */ -idEntity* idAI::Native_GetObstacle(void) { +idEntity* idAI::GetObstacle(void) { return move.obstacle.GetEntity(); } /* ===================== -idAI::Native_PushPointIntoAAS +idAI::PushPointIntoAAS ===================== */ -idVec3 idAI::Native_PushPointIntoAAS(const idVec3& pos) { +idVec3 idAI::PushPointIntoAAS(const idVec3& pos) { int areaNum; idVec3 newPos; @@ -2463,28 +2262,28 @@ idVec3 idAI::Native_PushPointIntoAAS(const idVec3& pos) { /* ===================== -idAI::Native_GetTurnRate +idAI::GetTurnRate ===================== */ -float idAI::Native_GetTurnRate(void) { +float idAI::GetTurnRate(void) { return turnRate; } /* ===================== -idAI::Native_SetTurnRate +idAI::SetTurnRate ===================== */ -void idAI::Native_SetTurnRate(float rate) { +void idAI::SetTurnRate(float rate) { turnRate = rate; } /* ===================== -idAI::Native_AnimTurn +idAI::AnimTurn ===================== */ -void idAI::Native_AnimTurn(float angles) { +void idAI::AnimTurn(float angles) { turnVel = 0.0f; anim_turn_angles = angles; if (angles) { @@ -2505,28 +2304,19 @@ void idAI::Native_AnimTurn(float angles) { /* ===================== -idAI::Native_AllowHiddenMovement +idAI::AllowHiddenMovement ===================== */ -void idAI::Native_AllowHiddenMovement(int enable) { +void idAI::AllowHiddenMovement(int enable) { allowHiddenMovement = (enable != 0); } /* ===================== -idAI::Native_TriggerParticles +idAI::FindActorsInBounds ===================== */ -void idAI::Native_TriggerParticles(const char* jointName) { - TriggerParticles(jointName); -} - -/* -===================== -idAI::Native_FindActorsInBounds -===================== -*/ -idEntity* idAI::Native_FindActorsInBounds(const idVec3& mins, const idVec3& maxs) { +idEntity* idAI::FindActorsInBounds(const idVec3& mins, const idVec3& maxs) { idEntity* ent; idEntity* entityList[MAX_GENTITIES]; int numListedEntities; @@ -2537,7 +2327,6 @@ idEntity* idAI::Native_FindActorsInBounds(const idVec3& mins, const idVec3& maxs ent = entityList[i]; if (ent != this && !ent->IsHidden() && (ent->health > 0) && ent->IsType(idActor::Type)) { return ent; - return NULL; } } @@ -2546,10 +2335,10 @@ idEntity* idAI::Native_FindActorsInBounds(const idVec3& mins, const idVec3& maxs /* ===================== -idAI::Native_CanReachPosition +idAI::CanReachPosition ===================== */ -int idAI::Native_CanReachPosition(const idVec3& pos) { +int idAI::CanReachPosition(const idVec3& pos) { aasPath_t path; int toAreaNum; int areaNum; @@ -2566,10 +2355,10 @@ int idAI::Native_CanReachPosition(const idVec3& pos) { /* ===================== -idAI::Native_CanReachEntity +idAI::CanReachEntity ===================== */ -int idAI::Native_CanReachEntity(idEntity* ent) { +int idAI::CanReachEntity(idEntity* ent) { aasPath_t path; int toAreaNum; int areaNum; @@ -2577,17 +2366,14 @@ int idAI::Native_CanReachEntity(idEntity* ent) { if (!ent) { return false; - return false; } if (move.moveType != MOVETYPE_FLY) { if (!ent->GetFloorPos(64.0f, pos)) { return false; - return false; } if (ent->IsType(idActor::Type) && static_cast(ent)->OnLadder()) { return false; - return false; } } else { @@ -2597,7 +2383,6 @@ int idAI::Native_CanReachEntity(idEntity* ent) { toAreaNum = PointReachableAreaNum(pos); if (!toAreaNum) { return false; - return false; } const idVec3& org = physicsObj.GetOrigin(); @@ -2612,10 +2397,10 @@ int idAI::Native_CanReachEntity(idEntity* ent) { /* ===================== -idAI::Native_CanReachEnemy +idAI::CanReachEnemy ===================== */ -int idAI::Native_CanReachEnemy(void) { +int idAI::CanReachEnemy(void) { aasPath_t path; int toAreaNum; int areaNum; @@ -2625,13 +2410,11 @@ int idAI::Native_CanReachEnemy(void) { enemyEnt = enemy.GetEntity(); if (!enemyEnt) { return false; - return false; } if (move.moveType != MOVETYPE_FLY) { if (enemyEnt->OnLadder()) { return false; - return false; } enemyEnt->GetAASLocation(aas, pos, toAreaNum); } @@ -2642,7 +2425,6 @@ int idAI::Native_CanReachEnemy(void) { if (!toAreaNum) { return false; - return false; } const idVec3& org = physicsObj.GetOrigin(); @@ -2657,10 +2439,10 @@ int idAI::Native_CanReachEnemy(void) { /* ===================== -idAI::Native_GetReachableEntityPosition +idAI::GetReachableEntityPosition ===================== */ -idVec3 idAI::Native_GetReachableEntityPosition(idEntity* ent) { +idVec3 idAI::GetReachableEntityPosition(idEntity* ent) { int toAreaNum; idVec3 pos; @@ -2688,37 +2470,37 @@ idVec3 idAI::Native_GetReachableEntityPosition(idEntity* ent) { /* ===================== -idAI::Native_WaitAction +idAI::WaitAction ===================== */ -void idAI::Native_WaitAction(const char* waitForState) { +void idAI::WaitAction(const char* waitForState) { SetWaitState(waitForState); } /* ===================== -idAI::Native_WaitActionDone +idAI::WaitActionDone ===================== */ -bool idAI::Native_WaitActionDone(void) const { +bool idAI::WaitActionDone(void) const { return (WaitState() == NULL); } /* ===================== -idAI::Native_WaitMoveDone +idAI::WaitMoveDone ===================== */ -bool idAI::Native_WaitMoveDone(void) const { +bool idAI::WaitMoveDone(void) const { return MoveDone(); } /* ===================== -idAI::Native_Shrivel +idAI::Shrivel ===================== */ -bool idAI::Native_Shrivel(float shrivel_time, bool firstFrame) { +bool idAI::Shrivel(float shrivel_time, bool firstFrame) { float t; if (firstFrame) { @@ -2752,7 +2534,7 @@ idAI::Event_Activate ===================== */ void idAI::Event_Activate(idEntity* activator) { - Native_Activate(activator); + Activate(activator); } /* @@ -2761,7 +2543,7 @@ idAI::Event_Touch ===================== */ void idAI::Event_Touch(idEntity* other, trace_t* trace) { - Native_Touch(other, trace); + Touch(other, trace); } /* @@ -2770,7 +2552,7 @@ idAI::Event_FindEnemy ===================== */ void idAI::Event_FindEnemy(int useFOV) { - idThread::ReturnEntity(Native_FindEnemy(useFOV)); + idThread::ReturnEntity(FindEnemy(useFOV)); } /* @@ -2779,7 +2561,7 @@ idAI::Event_FindEnemyAI ===================== */ void idAI::Event_FindEnemyAI(int useFOV) { - idThread::ReturnEntity(Native_FindEnemyAI(useFOV)); + idThread::ReturnEntity(FindEnemyAI(useFOV)); } /* @@ -2788,7 +2570,7 @@ idAI::Event_FindEnemyInCombatNodes ===================== */ void idAI::Event_FindEnemyInCombatNodes(void) { - idThread::ReturnEntity(Native_FindEnemyInCombatNodes()); + idThread::ReturnEntity(FindEnemyInCombatNodes()); } /* @@ -2797,7 +2579,7 @@ idAI::Event_ClosestReachableEnemyOfEntity ===================== */ void idAI::Event_ClosestReachableEnemyOfEntity(idEntity* team_mate) { - idThread::ReturnEntity(Native_ClosestReachableEnemyOfEntity(team_mate)); + idThread::ReturnEntity(ClosestReachableEnemyOfEntity(team_mate)); } /* @@ -2806,7 +2588,7 @@ idAI::Event_HeardSound ===================== */ void idAI::Event_HeardSound(int ignore_team) { - idThread::ReturnEntity(Native_HeardSound(ignore_team)); + idThread::ReturnEntity(HeardSound(ignore_team)); } /* @@ -2815,7 +2597,7 @@ idAI::Event_SetEnemy ===================== */ void idAI::Event_SetEnemy(idEntity* ent) { - Native_SetEnemy(ent); + SetEnemy(ent); } /* @@ -2824,7 +2606,7 @@ idAI::Event_ClearEnemy ===================== */ void idAI::Event_ClearEnemy(void) { - Native_ClearEnemy(); + ClearEnemy(); } /* @@ -2833,7 +2615,7 @@ idAI::Event_MuzzleFlash ===================== */ void idAI::Event_MuzzleFlash(const char* jointname) { - Native_MuzzleFlash(jointname); + MuzzleFlash(jointname); } /* @@ -2842,7 +2624,7 @@ idAI::Event_CreateMissile ===================== */ void idAI::Event_CreateMissile(const char* jointname) { - idThread::ReturnEntity(Native_CreateMissile(jointname)); + idThread::ReturnEntity(CreateMissile(jointname)); } /* @@ -2851,7 +2633,7 @@ idAI::Event_AttackMissile ===================== */ void idAI::Event_AttackMissile(const char* jointname) { - idThread::ReturnEntity(Native_AttackMissile(jointname)); + idThread::ReturnEntity(AttackMissile(jointname)); } /* @@ -2860,7 +2642,7 @@ idAI::Event_FireMissileAtTarget ===================== */ void idAI::Event_FireMissileAtTarget(const char* jointname, const char* targetname) { - idThread::ReturnEntity(Native_FireMissileAtTarget(jointname, targetname)); + idThread::ReturnEntity(FireMissileAtTarget(jointname, targetname)); } /* @@ -2869,7 +2651,7 @@ idAI::Event_LaunchMissile ===================== */ void idAI::Event_LaunchMissile(const idVec3& org, const idAngles& ang) { - idThread::ReturnEntity(Native_LaunchMissile(org, ang)); + idThread::ReturnEntity(LaunchMissile(org, ang)); } /* @@ -2878,7 +2660,7 @@ idAI::Event_AttackMelee ===================== */ void idAI::Event_AttackMelee(const char* meleeDefName) { - idThread::ReturnInt(Native_AttackMelee(meleeDefName)); + idThread::ReturnInt(AttackMelee(meleeDefName)); } /* @@ -2887,7 +2669,7 @@ idAI::Event_DirectDamage ===================== */ void idAI::Event_DirectDamage(idEntity* damageTarget, const char* damageDefName) { - Native_DirectDamage(damageTarget, damageDefName); + DirectDamage(damageTarget, damageDefName); } /* @@ -2896,7 +2678,7 @@ idAI::Event_RadiusDamageFromJoint ===================== */ void idAI::Event_RadiusDamageFromJoint(const char* jointname, const char* damageDefName) { - Native_RadiusDamageFromJoint(jointname, damageDefName); + RadiusDamageFromJoint(jointname, damageDefName); } /* @@ -2905,7 +2687,7 @@ idAI::Event_RandomPath ===================== */ void idAI::Event_RandomPath(void) { - idThread::ReturnEntity(Native_RandomPath()); + idThread::ReturnEntity(RandomPath()); } /* @@ -2914,7 +2696,7 @@ idAI::Event_BeginAttack ===================== */ void idAI::Event_BeginAttack(const char* name) { - Native_BeginAttack(name); + BeginAttack(name); } /* @@ -2923,7 +2705,7 @@ idAI::Event_EndAttack ===================== */ void idAI::Event_EndAttack(void) { - Native_EndAttack(); + EndAttack(); } /* @@ -2932,7 +2714,7 @@ idAI::Event_MeleeAttackToJoint ===================== */ void idAI::Event_MeleeAttackToJoint(const char* jointname, const char* meleeDefName) { - idThread::ReturnInt(Native_MeleeAttackToJoint(jointname, meleeDefName)); + idThread::ReturnInt(MeleeAttackToJoint(jointname, meleeDefName)); } /* @@ -2941,7 +2723,7 @@ idAI::Event_CanBecomeSolid ===================== */ void idAI::Event_CanBecomeSolid(void) { - idThread::ReturnFloat(Native_CanBecomeSolid()); + idThread::ReturnFloat(CanBecomeSolid()); } /* @@ -2950,7 +2732,7 @@ idAI::Event_BecomeSolid ===================== */ void idAI::Event_BecomeSolid(void) { - Native_BecomeSolid(); + BecomeSolid(); } /* @@ -2959,7 +2741,7 @@ idAI::Event_BecomeNonSolid ===================== */ void idAI::Event_BecomeNonSolid(void) { - Native_BecomeNonSolid(); + BecomeNonSolid(); } /* @@ -2968,7 +2750,7 @@ idAI::Event_BecomeRagdoll ===================== */ void idAI::Event_BecomeRagdoll(void) { - idThread::ReturnInt(Native_BecomeRagdoll()); + idThread::ReturnInt(BecomeRagdoll()); } /* @@ -2977,7 +2759,7 @@ idAI::Event_StopRagdoll ===================== */ void idAI::Event_StopRagdoll(void) { - Native_StopRagdoll(); + StopRagdoll(); } /* @@ -2986,7 +2768,7 @@ idAI::Event_SetHealth ===================== */ void idAI::Event_SetHealth(float newHealth) { - Native_SetHealth(newHealth); + SetHealth(newHealth); } /* @@ -2995,7 +2777,7 @@ idAI::Event_GetHealth ===================== */ void idAI::Event_GetHealth(void) { - idThread::ReturnFloat(Native_GetHealth()); + idThread::ReturnFloat(GetHealth()); } /* @@ -3004,7 +2786,7 @@ idAI::Event_AllowDamage ===================== */ void idAI::Event_AllowDamage(void) { - Native_AllowDamage(); + AllowDamage(); } /* @@ -3013,7 +2795,7 @@ idAI::Event_IgnoreDamage ===================== */ void idAI::Event_IgnoreDamage(void) { - Native_IgnoreDamage(); + IgnoreDamage(); } /* @@ -3022,7 +2804,7 @@ idAI::Event_GetCurrentYaw ===================== */ void idAI::Event_GetCurrentYaw(void) { - idThread::ReturnFloat(Native_GetCurrentYaw()); + idThread::ReturnFloat(GetCurrentYaw()); } /* @@ -3031,7 +2813,7 @@ idAI::Event_TurnTo ===================== */ void idAI::Event_TurnTo(float angle) { - Native_TurnTo(angle); + TurnTo(angle); } /* @@ -3040,7 +2822,7 @@ idAI::Event_TurnToPos ===================== */ void idAI::Event_TurnToPos(const idVec3& pos) { - Native_TurnToPos(pos); + TurnToPos(pos); } /* @@ -3049,7 +2831,7 @@ idAI::Event_TurnToEntity ===================== */ void idAI::Event_TurnToEntity(idEntity* ent) { - Native_TurnToEntity(ent); + TurnToEntity(ent); } /* @@ -3058,7 +2840,7 @@ idAI::Event_MoveStatus ===================== */ void idAI::Event_MoveStatus(void) { - idThread::ReturnInt(Native_MoveStatus()); + idThread::ReturnInt(MoveStatus()); } /* @@ -3067,7 +2849,7 @@ idAI::Event_StopMove ===================== */ void idAI::Event_StopMove(void) { - Native_StopMove(); + StopMove(); } /* @@ -3076,7 +2858,7 @@ idAI::Event_MoveToCover ===================== */ void idAI::Event_MoveToCover(void) { - Native_MoveToCover(); + MoveToCover(); } /* @@ -3085,7 +2867,7 @@ idAI::Event_MoveToEnemy ===================== */ void idAI::Event_MoveToEnemy(void) { - Native_MoveToEnemy(); + MoveToEnemy(); } /* @@ -3094,7 +2876,7 @@ idAI::Event_MoveToEnemyHeight ===================== */ void idAI::Event_MoveToEnemyHeight(void) { - Native_MoveToEnemyHeight(); + MoveToEnemyHeight(); } /* @@ -3103,7 +2885,7 @@ idAI::Event_MoveOutOfRange ===================== */ void idAI::Event_MoveOutOfRange(idEntity* entity, float range) { - Native_MoveOutOfRange(entity, range); + MoveOutOfRange(entity, range); } /* @@ -3112,7 +2894,12 @@ idAI::Event_MoveToAttackPosition ===================== */ void idAI::Event_MoveToAttackPosition(idEntity* entity, const char* attack_anim) { - Native_MoveToAttackPosition(entity, attack_anim); + const int anim = GetAnim(ANIMCHANNEL_LEGS, attack_anim); + if (!anim) { + gameLocal.Error("Unknown anim '%s'", attack_anim); + } + + MoveToAttackPosition(entity, anim); } /* @@ -3121,7 +2908,7 @@ idAI::Event_MoveToEntity ===================== */ void idAI::Event_MoveToEntity(idEntity* ent) { - Native_MoveToEntity(ent); + MoveToEntity(ent); } /* @@ -3130,7 +2917,7 @@ idAI::Event_MoveToPosition ===================== */ void idAI::Event_MoveToPosition(const idVec3& pos) { - Native_MoveToPosition(pos); + MoveToPosition(pos); } /* @@ -3139,7 +2926,7 @@ idAI::Event_SlideTo ===================== */ void idAI::Event_SlideTo(const idVec3& pos, float time) { - Native_SlideTo(pos, time); + SlideTo(pos, time); } /* @@ -3148,7 +2935,7 @@ idAI::Event_Wander ===================== */ void idAI::Event_Wander(void) { - Native_Wander(); + Wander(); } /* @@ -3157,7 +2944,7 @@ idAI::Event_FacingIdeal ===================== */ void idAI::Event_FacingIdeal(void) { - idThread::ReturnInt(Native_FacingIdeal()); + idThread::ReturnInt(FacingIdeal()); } /* @@ -3166,7 +2953,7 @@ idAI::Event_FaceEnemy ===================== */ void idAI::Event_FaceEnemy(void) { - Native_FaceEnemy(); + FaceEnemy(); } /* @@ -3175,7 +2962,7 @@ idAI::Event_FaceEntity ===================== */ void idAI::Event_FaceEntity(idEntity* ent) { - Native_FaceEntity(ent); + FaceEntity(ent); } /* @@ -3185,10 +2972,10 @@ idAI::Event_WaitAction */ void idAI::Event_WaitAction(const char* waitForState) { if (idThread::BeginMultiFrameEvent(this, &AI_WaitAction)) { - Native_WaitAction(waitForState); + WaitAction(waitForState); } - if (Native_WaitActionDone()) { + if (WaitActionDone()) { idThread::EndMultiFrameEvent(this, &AI_WaitAction); } } @@ -3199,7 +2986,7 @@ idAI::Event_GetCombatNode ===================== */ void idAI::Event_GetCombatNode(void) { - idThread::ReturnEntity(Native_GetCombatNode()); + idThread::ReturnEntity(GetCombatNode()); } /* @@ -3208,7 +2995,7 @@ idAI::Event_EnemyInCombatCone ===================== */ void idAI::Event_EnemyInCombatCone(idEntity* ent, int use_current_enemy_location) { - idThread::ReturnInt(Native_EnemyInCombatCone(ent, use_current_enemy_location)); + idThread::ReturnInt(EnemyInCombatCone(ent, use_current_enemy_location)); } /* @@ -3219,7 +3006,7 @@ idAI::Event_WaitMove void idAI::Event_WaitMove(void) { idThread::BeginMultiFrameEvent(this, &AI_WaitMove); - if (Native_WaitMoveDone()) { + if (WaitMoveDone()) { idThread::EndMultiFrameEvent(this, &AI_WaitMove); } } @@ -3230,7 +3017,7 @@ idAI::Event_GetJumpVelocity ===================== */ void idAI::Event_GetJumpVelocity(const idVec3& pos, float speed, float max_height) { - idThread::ReturnVector(Native_GetJumpVelocity(pos, speed, max_height)); + idThread::ReturnVector(GetJumpVelocity(pos, speed, max_height)); } /* @@ -3239,7 +3026,7 @@ idAI::Event_EntityInAttackCone ===================== */ void idAI::Event_EntityInAttackCone(idEntity* ent) { - idThread::ReturnInt(Native_EntityInAttackCone(ent)); + idThread::ReturnInt(EntityInAttackCone(ent)); } /* @@ -3248,7 +3035,7 @@ idAI::Event_CanSeeEntity ===================== */ void idAI::Event_CanSeeEntity(idEntity* ent) { - idThread::ReturnInt(Native_CanSeeEntity(ent)); + idThread::ReturnInt(CanSeeEntity(ent)); } /* @@ -3257,7 +3044,7 @@ idAI::Event_SetTalkTarget ===================== */ void idAI::Event_SetTalkTarget(idEntity* target) { - Native_SetTalkTarget(target); + SetTalkTarget(target); } /* @@ -3266,7 +3053,7 @@ idAI::Event_GetTalkTarget ===================== */ void idAI::Event_GetTalkTarget(void) { - idThread::ReturnEntity(Native_GetTalkTarget()); + idThread::ReturnEntity(GetTalkTarget()); } /* @@ -3275,7 +3062,7 @@ idAI::Event_SetTalkState ===================== */ void idAI::Event_SetTalkState(int state) { - Native_SetTalkState(state); + SetTalkState(state); } /* @@ -3284,7 +3071,7 @@ idAI::Event_EnemyRange ===================== */ void idAI::Event_EnemyRange(void) { - idThread::ReturnFloat(Native_EnemyRange()); + idThread::ReturnFloat(EnemyRange()); } /* @@ -3293,7 +3080,7 @@ idAI::Event_EnemyRange2D ===================== */ void idAI::Event_EnemyRange2D(void) { - idThread::ReturnFloat(Native_EnemyRange2D()); + idThread::ReturnFloat(EnemyRange2D()); } /* @@ -3302,7 +3089,7 @@ idAI::Event_GetEnemy ===================== */ void idAI::Event_GetEnemy(void) { - idThread::ReturnEntity(Native_GetEnemy()); + idThread::ReturnEntity(GetEnemy()); } /* @@ -3311,7 +3098,7 @@ idAI::Event_GetEnemyPos ===================== */ void idAI::Event_GetEnemyPos(void) { - idThread::ReturnVector(Native_GetEnemyPos()); + idThread::ReturnVector(GetEnemyPos()); } /* @@ -3320,7 +3107,7 @@ idAI::Event_GetEnemyEyePos ===================== */ void idAI::Event_GetEnemyEyePos(void) { - idThread::ReturnVector(Native_GetEnemyEyePos()); + idThread::ReturnVector(GetEnemyEyePos()); } /* @@ -3329,7 +3116,7 @@ idAI::Event_PredictEnemyPos ===================== */ void idAI::Event_PredictEnemyPos(float time) { - idThread::ReturnVector(Native_PredictEnemyPos(time)); + idThread::ReturnVector(PredictEnemyPos(time)); } /* @@ -3338,7 +3125,7 @@ idAI::Event_CanHitEnemy ===================== */ void idAI::Event_CanHitEnemy(void) { - idThread::ReturnInt(Native_CanHitEnemy()); + idThread::ReturnInt(CanHitEnemy()); } /* @@ -3347,7 +3134,7 @@ idAI::Event_CanHitEnemyFromAnim ===================== */ void idAI::Event_CanHitEnemyFromAnim(const char* animname) { - idThread::ReturnInt(Native_CanHitEnemyFromAnim(animname)); + idThread::ReturnInt(CanHitEnemyFromAnim(animname)); } /* @@ -3356,7 +3143,7 @@ idAI::Event_CanHitEnemyFromJoint ===================== */ void idAI::Event_CanHitEnemyFromJoint(const char* jointname) { - idThread::ReturnInt(Native_CanHitEnemyFromJoint(jointname)); + idThread::ReturnInt(CanHitEnemyFromJoint(jointname)); } /* @@ -3365,7 +3152,7 @@ idAI::Event_EnemyPositionValid ===================== */ void idAI::Event_EnemyPositionValid(void) { - idThread::ReturnInt(Native_EnemyPositionValid()); + idThread::ReturnInt(EnemyPositionValid()); } /* @@ -3374,7 +3161,7 @@ idAI::Event_ChargeAttack ===================== */ void idAI::Event_ChargeAttack(const char* damageDef) { - Native_ChargeAttack(damageDef); + ChargeAttack(damageDef); } /* @@ -3383,7 +3170,7 @@ idAI::Event_TestChargeAttack ===================== */ void idAI::Event_TestChargeAttack(void) { - idThread::ReturnFloat(Native_TestChargeAttack()); + idThread::ReturnFloat(TestChargeAttack()); } /* @@ -3392,7 +3179,7 @@ idAI::Event_TestAnimMoveTowardEnemy ===================== */ void idAI::Event_TestAnimMoveTowardEnemy(const char* animname) { - idThread::ReturnInt(Native_TestAnimMoveTowardEnemy(animname)); + idThread::ReturnInt(TestAnimMoveTowardEnemy(animname)); } /* @@ -3401,7 +3188,7 @@ idAI::Event_TestAnimMove ===================== */ void idAI::Event_TestAnimMove(const char* animname) { - idThread::ReturnInt(Native_TestAnimMove(animname)); + idThread::ReturnInt(TestAnimMove(animname)); } /* @@ -3410,7 +3197,7 @@ idAI::Event_TestMoveToPosition ===================== */ void idAI::Event_TestMoveToPosition(const idVec3& position) { - idThread::ReturnInt(Native_TestMoveToPosition(position)); + idThread::ReturnInt(TestMoveToPosition(position)); } /* @@ -3419,7 +3206,7 @@ idAI::Event_TestMeleeAttack ===================== */ void idAI::Event_TestMeleeAttack(void) { - idThread::ReturnInt(Native_TestMeleeAttack()); + idThread::ReturnInt(TestMeleeAttack()); } /* @@ -3428,7 +3215,7 @@ idAI::Event_TestAnimAttack ===================== */ void idAI::Event_TestAnimAttack(const char* animname) { - idThread::ReturnInt(Native_TestAnimAttack(animname)); + idThread::ReturnInt(TestAnimAttack(animname)); } /* @@ -3438,7 +3225,7 @@ idAI::Event_Shrivel */ void idAI::Event_Shrivel(float shrivel_time) { const bool firstFrame = idThread::BeginMultiFrameEvent(this, &AI_Shrivel); - if (Native_Shrivel(shrivel_time, firstFrame)) { + if (Shrivel(shrivel_time, firstFrame)) { idThread::EndMultiFrameEvent(this, &AI_Shrivel); } } @@ -3449,7 +3236,7 @@ idAI::Event_PreBurn ===================== */ void idAI::Event_PreBurn(void) { - Native_PreBurn(); + PreBurn(); } /* @@ -3458,7 +3245,7 @@ idAI::Event_Burn ===================== */ void idAI::Event_Burn(void) { - Native_Burn(); + Burn(); } /* @@ -3467,7 +3254,7 @@ idAI::Event_ClearBurn ===================== */ void idAI::Event_ClearBurn(void) { - Native_ClearBurn(); + ClearBurn(); } /* @@ -3476,7 +3263,7 @@ idAI::Event_SetSmokeVisibility ===================== */ void idAI::Event_SetSmokeVisibility(int num, int on) { - Native_SetSmokeVisibility(num, on); + SetSmokeVisibility(num, on); } /* @@ -3485,7 +3272,7 @@ idAI::Event_NumSmokeEmitters ===================== */ void idAI::Event_NumSmokeEmitters(void) { - idThread::ReturnInt(Native_NumSmokeEmitters()); + idThread::ReturnInt(NumSmokeEmitters()); } /* @@ -3494,7 +3281,7 @@ idAI::Event_StopThinking ===================== */ void idAI::Event_StopThinking(void) { - Native_StopThinking(); + StopThinking(); idThread* thread = idThread::CurrentThread(); if (thread) { thread->DoneProcessing(); @@ -3507,7 +3294,7 @@ idAI::Event_GetTurnDelta ===================== */ void idAI::Event_GetTurnDelta(void) { - idThread::ReturnFloat(Native_GetTurnDelta()); + idThread::ReturnFloat(GetTurnDelta()); } /* @@ -3516,7 +3303,7 @@ idAI::Event_GetMoveType ===================== */ void idAI::Event_GetMoveType(void) { - idThread::ReturnInt(Native_GetMoveType()); + idThread::ReturnInt(GetMoveType()); } /* @@ -3525,7 +3312,7 @@ idAI::Event_SetMoveType ===================== */ void idAI::Event_SetMoveType(int moveType) { - Native_SetMoveType(moveType); + SetMoveType(moveType); } /* @@ -3534,7 +3321,7 @@ idAI::Event_SaveMove ===================== */ void idAI::Event_SaveMove(void) { - Native_SaveMove(); + SaveMove(); } /* @@ -3543,7 +3330,7 @@ idAI::Event_RestoreMove ===================== */ void idAI::Event_RestoreMove(void) { - Native_RestoreMove(); + RestoreMove(); } /* @@ -3552,7 +3339,7 @@ idAI::Event_AllowMovement ===================== */ void idAI::Event_AllowMovement(float flag) { - Native_AllowMovement(flag); + AllowMovement(flag); } /* @@ -3561,7 +3348,7 @@ idAI::Event_JumpFrame ===================== */ void idAI::Event_JumpFrame(void) { - Native_JumpFrame(); + JumpFrame(); } /* @@ -3570,7 +3357,7 @@ idAI::Event_EnableClip ===================== */ void idAI::Event_EnableClip(void) { - Native_EnableClip(); + EnableClip(); } /* @@ -3579,7 +3366,7 @@ idAI::Event_DisableClip ===================== */ void idAI::Event_DisableClip(void) { - Native_DisableClip(); + DisableClip(); } /* @@ -3588,7 +3375,7 @@ idAI::Event_EnableGravity ===================== */ void idAI::Event_EnableGravity(void) { - Native_EnableGravity(); + EnableGravity(); } /* @@ -3597,7 +3384,7 @@ idAI::Event_DisableGravity ===================== */ void idAI::Event_DisableGravity(void) { - Native_DisableGravity(); + DisableGravity(); } /* @@ -3606,7 +3393,7 @@ idAI::Event_EnableAFPush ===================== */ void idAI::Event_EnableAFPush(void) { - Native_EnableAFPush(); + EnableAFPush(); } /* @@ -3615,7 +3402,7 @@ idAI::Event_DisableAFPush ===================== */ void idAI::Event_DisableAFPush(void) { - Native_DisableAFPush(); + DisableAFPush(); } /* @@ -3624,7 +3411,7 @@ idAI::Event_SetFlySpeed ===================== */ void idAI::Event_SetFlySpeed(float speed) { - Native_SetFlySpeed(speed); + SetFlySpeed(speed); } /* @@ -3633,7 +3420,7 @@ idAI::Event_SetFlyOffset ===================== */ void idAI::Event_SetFlyOffset(int offset) { - Native_SetFlyOffset(offset); + SetFlyOffset(offset); } /* @@ -3642,7 +3429,7 @@ idAI::Event_ClearFlyOffset ===================== */ void idAI::Event_ClearFlyOffset(void) { - Native_ClearFlyOffset(); + ClearFlyOffset(); } /* @@ -3651,7 +3438,7 @@ idAI::Event_GetClosestHiddenTarget ===================== */ void idAI::Event_GetClosestHiddenTarget(const char* type) { - idThread::ReturnEntity(Native_GetClosestHiddenTarget(type)); + idThread::ReturnEntity(GetClosestHiddenTarget(type)); } /* @@ -3660,7 +3447,7 @@ idAI::Event_GetRandomTarget ===================== */ void idAI::Event_GetRandomTarget(const char* type) { - idThread::ReturnEntity(Native_GetRandomTarget(type)); + idThread::ReturnEntity(GetRandomTarget(type)); } /* @@ -3669,7 +3456,7 @@ idAI::Event_TravelDistanceToPoint ===================== */ void idAI::Event_TravelDistanceToPoint(const idVec3& pos) { - idThread::ReturnFloat(Native_TravelDistanceToPoint(pos)); + idThread::ReturnFloat(TravelDistanceToPoint(pos)); } /* @@ -3678,7 +3465,7 @@ idAI::Event_TravelDistanceToEntity ===================== */ void idAI::Event_TravelDistanceToEntity(idEntity* ent) { - idThread::ReturnFloat(Native_TravelDistanceToEntity(ent)); + idThread::ReturnFloat(TravelDistanceToEntity(ent)); } /* @@ -3687,7 +3474,7 @@ idAI::Event_TravelDistanceBetweenPoints ===================== */ void idAI::Event_TravelDistanceBetweenPoints(const idVec3& source, const idVec3& dest) { - idThread::ReturnFloat(Native_TravelDistanceBetweenPoints(source, dest)); + idThread::ReturnFloat(TravelDistanceBetweenPoints(source, dest)); } /* @@ -3696,7 +3483,7 @@ idAI::Event_TravelDistanceBetweenEntities ===================== */ void idAI::Event_TravelDistanceBetweenEntities(idEntity* source, idEntity* dest) { - idThread::ReturnFloat(Native_TravelDistanceBetweenEntities(source, dest)); + idThread::ReturnFloat(TravelDistanceBetweenEntities(source, dest)); } /* @@ -3705,7 +3492,7 @@ idAI::Event_LookAtEntity ===================== */ void idAI::Event_LookAtEntity(idEntity* ent, float duration) { - Native_LookAtEntity(ent, duration); + LookAtEntity(ent, duration); } /* @@ -3714,7 +3501,7 @@ idAI::Event_LookAtEnemy ===================== */ void idAI::Event_LookAtEnemy(float duration) { - Native_LookAtEnemy(duration); + LookAtEnemy(duration); } /* @@ -3723,7 +3510,7 @@ idAI::Event_SetJointMod ===================== */ void idAI::Event_SetJointMod(int allow) { - Native_SetJointMod(allow); + SetJointMod(allow); } /* @@ -3732,7 +3519,7 @@ idAI::Event_ThrowMoveable ===================== */ void idAI::Event_ThrowMoveable(void) { - Native_ThrowMoveable(); + ThrowMoveable(); } /* @@ -3741,7 +3528,7 @@ idAI::Event_ThrowAF ===================== */ void idAI::Event_ThrowAF(void) { - Native_ThrowAF(); + ThrowAF(); } /* @@ -3750,7 +3537,7 @@ idAI::Event_SetAngles ===================== */ void idAI::Event_SetAngles(idAngles const& ang) { - Native_SetAngles(ang); + SetAngles(ang); } /* @@ -3759,7 +3546,7 @@ idAI::Event_GetAngles ===================== */ void idAI::Event_GetAngles(void) { - idThread::ReturnVector(Native_GetAngles()); + idThread::ReturnVector(GetAngles()); } /* @@ -3768,7 +3555,7 @@ idAI::Event_RealKill ===================== */ void idAI::Event_RealKill(void) { - Native_RealKill(); + RealKill(); } /* @@ -3777,7 +3564,7 @@ idAI::Event_Kill ===================== */ void idAI::Event_Kill(void) { - Native_Kill(); + Kill(); } /* @@ -3786,7 +3573,7 @@ idAI::Event_WakeOnFlashlight ===================== */ void idAI::Event_WakeOnFlashlight(int enable) { - Native_WakeOnFlashlight(enable); + WakeOnFlashlight(enable); } /* @@ -3795,7 +3582,7 @@ idAI::Event_LocateEnemy ===================== */ void idAI::Event_LocateEnemy(void) { - Native_LocateEnemy(); + LocateEnemy(); } /* @@ -3804,7 +3591,7 @@ idAI::Event_KickObstacles ===================== */ void idAI::Event_KickObstacles(idEntity* kickEnt, float force) { - Native_KickObstacles(kickEnt, force); + KickObstacles(kickEnt, force); } /* @@ -3813,7 +3600,7 @@ idAI::Event_GetObstacle ===================== */ void idAI::Event_GetObstacle(void) { - idThread::ReturnEntity(Native_GetObstacle()); + idThread::ReturnEntity(GetObstacle()); } /* @@ -3822,7 +3609,7 @@ idAI::Event_PushPointIntoAAS ===================== */ void idAI::Event_PushPointIntoAAS(const idVec3& pos) { - idThread::ReturnVector(Native_PushPointIntoAAS(pos)); + idThread::ReturnVector(PushPointIntoAAS(pos)); } /* @@ -3831,7 +3618,7 @@ idAI::Event_GetTurnRate ===================== */ void idAI::Event_GetTurnRate(void) { - idThread::ReturnFloat(Native_GetTurnRate()); + idThread::ReturnFloat(GetTurnRate()); } /* @@ -3840,7 +3627,7 @@ idAI::Event_SetTurnRate ===================== */ void idAI::Event_SetTurnRate(float rate) { - Native_SetTurnRate(rate); + SetTurnRate(rate); } /* @@ -3849,7 +3636,7 @@ idAI::Event_AnimTurn ===================== */ void idAI::Event_AnimTurn(float angles) { - Native_AnimTurn(angles); + AnimTurn(angles); } /* @@ -3858,7 +3645,7 @@ idAI::Event_AllowHiddenMovement ===================== */ void idAI::Event_AllowHiddenMovement(int enable) { - Native_AllowHiddenMovement(enable); + AllowHiddenMovement(enable); } /* @@ -3867,7 +3654,7 @@ idAI::Event_TriggerParticles ===================== */ void idAI::Event_TriggerParticles(const char* jointName) { - Native_TriggerParticles(jointName); + TriggerParticles(jointName); } /* @@ -3876,7 +3663,7 @@ idAI::Event_FindActorsInBounds ===================== */ void idAI::Event_FindActorsInBounds(const idVec3& mins, const idVec3& maxs) { - idThread::ReturnEntity(Native_FindActorsInBounds(mins, maxs)); + idThread::ReturnEntity(FindActorsInBounds(mins, maxs)); } /* @@ -3885,7 +3672,7 @@ idAI::Event_CanReachPosition ===================== */ void idAI::Event_CanReachPosition(const idVec3& pos) { - idThread::ReturnInt(Native_CanReachPosition(pos)); + idThread::ReturnInt(CanReachPosition(pos)); } /* @@ -3894,7 +3681,7 @@ idAI::Event_CanReachEntity ===================== */ void idAI::Event_CanReachEntity(idEntity* ent) { - idThread::ReturnInt(Native_CanReachEntity(ent)); + idThread::ReturnInt(CanReachEntity(ent)); } /* @@ -3903,7 +3690,7 @@ idAI::Event_CanReachEnemy ===================== */ void idAI::Event_CanReachEnemy(void) { - idThread::ReturnInt(Native_CanReachEnemy()); + idThread::ReturnInt(CanReachEnemy()); } /* @@ -3912,6 +3699,6 @@ idAI::Event_GetReachableEntityPosition ===================== */ void idAI::Event_GetReachableEntityPosition(idEntity* ent) { - idThread::ReturnVector(Native_GetReachableEntityPosition(ent)); + idThread::ReturnVector(GetReachableEntityPosition(ent)); }