28 lines
600 B
C++
28 lines
600 B
C++
#include "precompile.h"
|
|
|
|
#include "btcoroutine.h"
|
|
#include "creature.h"
|
|
#include "trigger.h"
|
|
#include "base_agent.h"
|
|
#include "btcontext.h"
|
|
#include "btevent.h"
|
|
|
|
bool BtCoroutine::HasEvent()
|
|
{
|
|
if (!context->events.empty()) {
|
|
auto event = context->events.at(context->events.size() - 1);
|
|
return event->HasEvent();
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void BtCoroutine::FireEvent(BaseAgent* agent)
|
|
{
|
|
if (!context->events.empty()) {
|
|
auto event = context->events.at(context->events.size() - 1);
|
|
if (event->HasEvent()) {
|
|
event->FireEvent(agent);
|
|
}
|
|
}
|
|
}
|