fix: Make Trigger call SpatialObject::update
This commit is contained in:
parent
2418e31de4
commit
0af3ce965a
3 changed files with 3 additions and 2 deletions
|
@ -776,6 +776,7 @@ void Area::checkTriggersIntersection(SpatialObject &triggerrer) {
|
|||
if (trigger.distanceTo(position2d) > kMaxDistanceToTestCollision) continue;
|
||||
if (trigger.isTenant(triggererPtr) || !trigger.isIn(position2d)) continue;
|
||||
|
||||
debug(boost::format("Trigger %s triggerred by %s") % trigger.tag() % triggerrer.tag());
|
||||
trigger.addTenant(triggererPtr);
|
||||
|
||||
if (!trigger.linkedToModule().empty()) {
|
||||
|
|
|
@ -81,11 +81,12 @@ void Trigger::update(float dt) {
|
|||
tenantsToRemove.insert(tenant);
|
||||
}
|
||||
for (auto &tenant : tenantsToRemove) {
|
||||
_tenants.erase(tenant);
|
||||
if (!_blueprint->onExit().empty()) {
|
||||
runScript(_blueprint->onExit(), id(), tenant->id(), -1);
|
||||
}
|
||||
_tenants.erase(tenant);
|
||||
}
|
||||
SpatialObject::update(dt);
|
||||
}
|
||||
|
||||
bool Trigger::isIn(const glm::vec2 &point) const {
|
||||
|
|
|
@ -48,7 +48,6 @@ public:
|
|||
|
||||
private:
|
||||
std::shared_ptr<TriggerBlueprint> _blueprint;
|
||||
std::string _tag;
|
||||
std::string _transitionDestin;
|
||||
std::string _linkedToModule;
|
||||
std::string _linkedTo;
|
||||
|
|
Loading…
Reference in a new issue