mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-29 22:27:57 +03:00
Added AI_EVENT_BADPLACE
This commit is contained in:
parent
7a2311d6e6
commit
1e94cdd8ca
2 changed files with 67 additions and 60 deletions
|
@ -5581,9 +5581,7 @@ Default pain handler.
|
||||||
*/
|
*/
|
||||||
void Actor::DefaultPain(Event *ev)
|
void Actor::DefaultPain(Event *ev)
|
||||||
{
|
{
|
||||||
gi.Printf("DefaultPain event");
|
|
||||||
SetThink(THINKSTATE_PAIN, THINK_PAIN);
|
SetThink(THINKSTATE_PAIN, THINK_PAIN);
|
||||||
|
|
||||||
HandlePain(ev);
|
HandlePain(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5660,9 +5658,7 @@ Default killed handler.
|
||||||
void Actor::DefaultKilled(Event *ev, bool bPlayDeathAnim)
|
void Actor::DefaultKilled(Event *ev, bool bPlayDeathAnim)
|
||||||
{
|
{
|
||||||
ClearStates();
|
ClearStates();
|
||||||
|
|
||||||
SetThink(THINKSTATE_KILLED, THINK_KILLED);
|
SetThink(THINKSTATE_KILLED, THINK_KILLED);
|
||||||
|
|
||||||
HandleKilled(ev, bPlayDeathAnim);
|
HandleKilled(ev, bPlayDeathAnim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9363,10 +9359,16 @@ void Actor::DefaultReceiveAIEvent(
|
||||||
vec3_t event_origin, int iType, Entity *originator, float fDistSquared, float fMaxDistSquared
|
vec3_t event_origin, int iType, Entity *originator, float fDistSquared, float fMaxDistSquared
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!IsDead()) {
|
if (IsDead()) {
|
||||||
if (!originator->IsDead() && originator->IsSubclassOfSentient() && ((Sentient *)originator)->m_Team == m_Team
|
return;
|
||||||
&& !IsSquadMate((Sentient *)originator)) {
|
}
|
||||||
MergeWithSquad((Sentient *)originator);
|
|
||||||
|
if (originator
|
||||||
|
&& !originator->IsDead()
|
||||||
|
&& originator->IsSubclassOfSentient()
|
||||||
|
&& ((Sentient*)originator)->m_Team == m_Team
|
||||||
|
&& !IsSquadMate((Sentient*)originator)) {
|
||||||
|
MergeWithSquad((Sentient*)originator);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (iType) {
|
switch (iType) {
|
||||||
|
@ -9399,16 +9401,18 @@ void Actor::DefaultReceiveAIEvent(
|
||||||
case AI_EVENT_GRENADE:
|
case AI_EVENT_GRENADE:
|
||||||
GrenadeNotification(originator);
|
GrenadeNotification(originator);
|
||||||
break;
|
break;
|
||||||
|
case AI_EVENT_BADPLACE:
|
||||||
|
UpdateBadPlaces();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
char assertStr[16317] = {0};
|
char assertStr[16317] = { 0 };
|
||||||
strcpy(assertStr, "\"unknown ai_event type\"\n\tMessage: ");
|
strcpy(assertStr, "\"unknown ai_event type\"\n\tMessage: ");
|
||||||
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("iType = %i", iType));
|
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("iType = %i", iType));
|
||||||
assert(false && assertStr);
|
assert(false && assertStr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -334,19 +334,6 @@ enum eThinkState {
|
||||||
NUM_THINKSTATES,
|
NUM_THINKSTATES,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define AI_EVENT_NONE 0
|
|
||||||
#define AI_EVENT_WEAPON_FIRE 1
|
|
||||||
#define AI_EVENT_WEAPON_IMPACT 2
|
|
||||||
#define AI_EVENT_EXPLOSION 3
|
|
||||||
#define AI_EVENT_AMERICAN_VOICE 4
|
|
||||||
#define AI_EVENT_GERMAN_VOICE 5
|
|
||||||
#define AI_EVENT_AMERICAN_URGENT 6
|
|
||||||
#define AI_EVENT_GERMAN_URGENT 7
|
|
||||||
#define AI_EVENT_MISC 8
|
|
||||||
#define AI_EVENT_MISC_LOUD 9
|
|
||||||
#define AI_EVENT_FOOTSTEP 10
|
|
||||||
#define AI_EVENT_GRENADE 11
|
|
||||||
|
|
||||||
enum eThinkNum {
|
enum eThinkNum {
|
||||||
THINK_VOID,
|
THINK_VOID,
|
||||||
THINK_TURRET,
|
THINK_TURRET,
|
||||||
|
@ -396,6 +383,22 @@ 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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue