Fix UB when a unique effect script adds another unique effect during initialization
This commit is contained in:
parent
996dc77967
commit
a59ff847bc
@ -1,4 +1,4 @@
|
|||||||
[{"op":"merge", "path":"", "value": {
|
{
|
||||||
"createCharButton" : {
|
"createCharButton" : {
|
||||||
"type" : "button",
|
"type" : "button",
|
||||||
"base" : "/interface/title/createcharacter.png",
|
"base" : "/interface/title/createcharacter.png",
|
||||||
@ -6,4 +6,4 @@
|
|||||||
"position" : [23, 241],
|
"position" : [23, 241],
|
||||||
"pressedOffset" : [0, 0]
|
"pressedOffset" : [0, 0]
|
||||||
}
|
}
|
||||||
}}]
|
}
|
||||||
|
@ -410,8 +410,9 @@ void StatusController::init(Entity* parentEntity, ActorMovementController* movem
|
|||||||
|
|
||||||
if (m_parentEntity->isMaster()) {
|
if (m_parentEntity->isMaster()) {
|
||||||
initPrimaryScript();
|
initPrimaryScript();
|
||||||
for (auto& p : m_uniqueEffects)
|
for (auto& p : m_uniqueEffects.keys())
|
||||||
initUniqueEffectScript(p.second);
|
if (auto effect = m_uniqueEffects.ptr(p))
|
||||||
|
initUniqueEffectScript(*effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_environmentStatusEffectUpdateTimer.reset();
|
m_environmentStatusEffectUpdateTimer.reset();
|
||||||
@ -421,8 +422,9 @@ void StatusController::uninit() {
|
|||||||
m_parentEntity = nullptr;
|
m_parentEntity = nullptr;
|
||||||
m_movementController = nullptr;
|
m_movementController = nullptr;
|
||||||
|
|
||||||
for (auto& p : m_uniqueEffects)
|
for (auto& p : m_uniqueEffects.keys())
|
||||||
uninitUniqueEffectScript(p.second);
|
if (auto effect = m_uniqueEffects.ptr(p))
|
||||||
|
uninitUniqueEffectScript(*effect);
|
||||||
uninitPrimaryScript();
|
uninitPrimaryScript();
|
||||||
|
|
||||||
m_recentHitsGiven.reset();
|
m_recentHitsGiven.reset();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user