Moved eAIEvent enum to entity.h

This commit is contained in:
smallmodel 2023-11-05 21:00:41 +01:00
parent 379a4b0ce4
commit 2b92869683
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 22 additions and 29 deletions

View file

@ -387,22 +387,6 @@ enum eThinkLevel {
NUM_THINKLEVELS NUM_THINKLEVELS
}; };
enum eAIEvent {
AI_EVENT_NONE,
AI_EVENT_WEAPON_FIRE,
AI_EVENT_WEAPON_IMPACT,
AI_EVENT_EXPLOSION,
AI_EVENT_AMERICAN_VOICE,
AI_EVENT_GERMAN_VOICE,
AI_EVENT_AMERICAN_URGENT,
AI_EVENT_GERMAN_URGENT,
AI_EVENT_MISC,
AI_EVENT_MISC_LOUD,
AI_EVENT_FOOTSTEP,
AI_EVENT_GRENADE,
AI_EVENT_BADPLACE // Added in 2.0
};
enum eActorNationality { enum eActorNationality {
ACTOR_NATIONALITY_DEFAULT, ACTOR_NATIONALITY_DEFAULT,
ACTOR_NATIONALITY_AMERICAN, ACTOR_NATIONALITY_AMERICAN,

View file

@ -1,6 +1,6 @@
/* /*
=========================================================================== ===========================================================================
Copyright (C) 2015 the OpenMoHAA team Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code. This file is part of OpenMoHAA source code.
@ -43,8 +43,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// not be ignored at any cost). // not be ignored at any cost).
// //
#ifndef __ENTITY_H__ #pragma once
#define __ENTITY_H__
#include "g_local.h" #include "g_local.h"
#include "class.h" #include "class.h"
@ -69,6 +68,22 @@ typedef enum {
torso, torso,
} bodypart_t; } bodypart_t;
enum eAIEvent {
AI_EVENT_NONE,
AI_EVENT_WEAPON_FIRE,
AI_EVENT_WEAPON_IMPACT,
AI_EVENT_EXPLOSION,
AI_EVENT_AMERICAN_VOICE,
AI_EVENT_GERMAN_VOICE,
AI_EVENT_AMERICAN_URGENT,
AI_EVENT_GERMAN_URGENT,
AI_EVENT_MISC,
AI_EVENT_MISC_LOUD,
AI_EVENT_FOOTSTEP,
AI_EVENT_GRENADE,
AI_EVENT_BADPLACE // Added in 2.0
};
//deadflag //deadflag
#define DEAD_NO 0 #define DEAD_NO 0
#define DEAD_DYING 1 #define DEAD_DYING 1
@ -481,7 +496,7 @@ public:
void RenderEffects(Event *ev); void RenderEffects(Event *ev);
void SVFlags(Event *ev); void SVFlags(Event *ev);
void BroadcastAIEvent(int iType = 8, float rad = SOUND_RADIUS); void BroadcastAIEvent(int iType = AI_EVENT_MISC, float rad = SOUND_RADIUS);
void BroadcastAIEvent(Event *ev); void BroadcastAIEvent(Event *ev);
void Kill(Event *ev); void Kill(Event *ev);
void Killed(Event *ev); void Killed(Event *ev);
@ -628,13 +643,9 @@ public:
void PlayNonPvsSound(const str& soundName, float volume = 1); void PlayNonPvsSound(const str& soundName, float volume = 1);
}; };
inline void Entity::PreAnimate(void) inline void Entity::PreAnimate(void) {}
{
}
inline void Entity::PostAnimate(void) inline void Entity::PostAnimate(void) {}
{
}
inline bool Entity::HasVehicle(void) const inline bool Entity::HasVehicle(void) const
{ {
@ -830,11 +841,9 @@ inline str Entity::GetRandomAlias(str name, AliasListNode_t **ret)
return realname; return realname;
} }
inline bool Entity::AreasConnected(const Entity* other) inline bool Entity::AreasConnected(const Entity *other)
{ {
return gi.AreasConnected(edict->r.areanum, other->edict->r.areanum) != 0; return gi.AreasConnected(edict->r.areanum, other->edict->r.areanum) != 0;
} }
#include "worldspawn.h" #include "worldspawn.h"
#endif