mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Re-enabled intrusive_ptr
This commit is contained in:
@@ -134,20 +134,8 @@ void SetScriptManager::initDependencies(Context& ctx, StyleSheet& stylesheet) {
|
||||
void SetScriptManager::onAction(const Action& action, bool undone) {
|
||||
TYPE_CASE(action, ValueAction) {
|
||||
if (action.card) {
|
||||
#ifdef USE_INTRUSIVE_PTR
|
||||
// we can just turn the Card* into a CardP
|
||||
updateValue(*action.valueP, CardP(const_cast<Card*>(action.card)));
|
||||
return;
|
||||
#else
|
||||
// find the affected card
|
||||
FOR_EACH(card, set.cards) {
|
||||
if (card->data.contains(action.valueP)) {
|
||||
updateValue(*action.valueP, card);
|
||||
return;
|
||||
}
|
||||
}
|
||||
assert(false);
|
||||
#endif
|
||||
updateValue(*action.valueP, const_cast<Card*>(action.card)->intrusive_from_this());
|
||||
return;
|
||||
} else {
|
||||
// is it a keyword's fake value?
|
||||
KeywordTextValue* value = dynamic_cast<KeywordTextValue*>(action.valueP.get());
|
||||
|
||||
Reference in New Issue
Block a user