Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/notes/bugfix-11950.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# mark card does not work
47 changes: 28 additions & 19 deletions engine/src/cmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,32 +1096,41 @@ void MCMarking::exec_ctxt(MCExecContext &ctxt)
else
MCInterfaceExecUnmarkCard(ctxt, t_object);
}
if (tofind == nil)
if (mark)
// SN-2014-03-21 [[ Bug 11950 ]]: 'mark' shouldn't throw an error when failing to mark when card is nil
// Any error set is discarded in the end of this block - unless is was triggered by a bad string.
else
{
if (tofind == nil)
{
if (where != nil)
MCInterfaceExecMarkCardsConditional(ctxt, where);
if (mark)
{
if (where != nil)
MCInterfaceExecMarkCardsConditional(ctxt, where);
else
MCInterfaceExecMarkAllCards(ctxt);
}
else
MCInterfaceExecMarkAllCards(ctxt);
{
if (where != nil)
MCInterfaceExecUnmarkCardsConditional(ctxt, where);
else
MCInterfaceExecUnmarkAllCards(ctxt);
}
}
else
{
if (where != nil)
MCInterfaceExecUnmarkCardsConditional(ctxt, where);
MCAutoStringRef t_needle;

if (!ctxt . EvalExprAsStringRef(tofind, EE_MARK_BADSTRING, &t_needle))
return;

if (mark)
MCInterfaceExecMarkFind(ctxt, mode, *t_needle, field);
else
MCInterfaceExecUnmarkAllCards(ctxt);
MCInterfaceExecUnmarkFind(ctxt, mode, *t_needle, field);
}
else
{
MCAutoStringRef t_needle;

if (!ctxt . EvalExprAsStringRef(tofind, EE_MARK_BADSTRING, &t_needle))
return;

if (mark)
MCInterfaceExecMarkFind(ctxt, mode, *t_needle, field);
else
MCInterfaceExecUnmarkFind(ctxt, mode, *t_needle, field);

ctxt . IgnoreLastError();
}
}

Expand Down