summaryrefslogtreecommitdiff
path: root/src/KingSystem/ActorSystem/actActorParam.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-11-08 12:22:08 +0100
committerLéo Lam <leo@leolam.fr>2020-11-08 12:22:08 +0100
commitad01b2b1fbd4deb987a43261b1a3160d549a3c98 (patch)
treeba606f3fae717f7eaef4ac06fc1fdf82f25db34a /src/KingSystem/ActorSystem/actActorParam.cpp
parent9eb8806b6f13e821dad94324e46851725e2b6d62 (diff)
ksys/act: Fix matching issue in ActorParam
Diffstat (limited to 'src/KingSystem/ActorSystem/actActorParam.cpp')
-rw-r--r--src/KingSystem/ActorSystem/actActorParam.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/KingSystem/ActorSystem/actActorParam.cpp b/src/KingSystem/ActorSystem/actActorParam.cpp
index 26b89dc5..7ce2bc06 100644
--- a/src/KingSystem/ActorSystem/actActorParam.cpp
+++ b/src/KingSystem/ActorSystem/actActorParam.cpp
@@ -11,7 +11,7 @@ void ActorParam::resetDummyResources() {
ActorParam::ActorParam() {
mRes = {};
- mNumHandles1 = mNumHandles2 = 0;
+ mNumHandles = {};
mEvent.resetSignal();
}
@@ -26,13 +26,11 @@ void ActorParam::deleteData() {
if (mActorName.isEmpty())
return;
- for (s32 i = 0; i < mNumHandles1; ++i)
- mHandles1[i].requestUnload();
- mNumHandles1 = 0;
-
- for (s32 i = 0; i < mNumHandles2; ++i)
- mHandles2[i].requestUnload();
- mNumHandles2 = 0;
+ for (size_t i = 0; i < mNumHandles.size(); ++i) {
+ for (s32 handle_idx = 0; handle_idx < mNumHandles[i]; ++handle_idx)
+ mHandles[i][handle_idx].requestUnload();
+ mNumHandles[i] = 0;
+ }
deleteResHandles();
@@ -44,8 +42,8 @@ void ActorParam::deleteData() {
}
void ActorParam::deleteResHandles() {
- mHandles1.freeBuffer();
- mHandles2.freeBuffer();
+ for (auto& handles : mHandles)
+ handles.freeBuffer();
}
bool ActorParam::isDummyParam(res::ActorLink::Users::User user) const {