From 2eb8988d7389d6a2730cdb43a3fc4dd26ab13ccf Mon Sep 17 00:00:00 2001 From: momo5502 Date: Mon, 21 Jan 2019 23:42:28 +0100 Subject: [PATCH] Fix entity move assignment --- src/game/scripting/entity.cpp | 2 ++ src/game/scripting/scheduler.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/scripting/entity.cpp b/src/game/scripting/entity.cpp index ea92eb4..a1c875a 100644 --- a/src/game/scripting/entity.cpp +++ b/src/game/scripting/entity.cpp @@ -53,6 +53,8 @@ namespace game { if (&other != this) { + this->release(); + this->context_ = other.context_; this->entity_id_ = other.entity_id_; diff --git a/src/game/scripting/scheduler.cpp b/src/game/scripting/scheduler.cpp index 4c99ab1..7d2c28a 100644 --- a/src/game/scripting/scheduler.cpp +++ b/src/game/scripting/scheduler.cpp @@ -79,7 +79,7 @@ namespace game void scheduler::remove(const task_handle& handle) { - for (const auto task : this->tasks_) + for (const auto& task : this->tasks_) { if(task->id == handle.id) {