This commit is contained in:
aozhiwei 2021-08-23 11:00:29 +08:00
parent cbc5256960
commit 1169bc8bb9

View File

@ -6,6 +6,7 @@
#include "creature.h" #include "creature.h"
#include "metamgr.h" #include "metamgr.h"
#include "skill.h" #include "skill.h"
#include "room.h"
void Trigger::Init() void Trigger::Init()
{ {
@ -192,6 +193,9 @@ void Trigger::TraverseCondBuffs(int cond, std::function<void (Buff*, bool&)> fun
if (!IsValidCondBuff(cond)) { if (!IsValidCondBuff(cond)) {
abort(); abort();
} }
if (!owner_->room->BattleStarted()) {
return;
}
list_head* pos = nullptr; list_head* pos = nullptr;
list_head* next = nullptr; list_head* next = nullptr;
@ -218,6 +222,10 @@ void Trigger::TraverseCondBuffs(int cond, std::function<void (Buff*, bool&)> fun
void Trigger::TriggeCondBuffAll(int cond) void Trigger::TriggeCondBuffAll(int cond)
{ {
if (!owner_->room->BattleStarted()) {
return;
}
std::shared_ptr<Ability> old_context_ability = owner_->context_ability; std::shared_ptr<Ability> old_context_ability = owner_->context_ability;
a8::Vec2 old_context_dir = owner_->context_dir; a8::Vec2 old_context_dir = owner_->context_dir;
a8::Vec2 old_context_pos = owner_->context_pos; a8::Vec2 old_context_pos = owner_->context_pos;