}
}
+/** True if unparse_boolexp() is being evaluated. */
+int unparsing_boolexp = 0;
+
/** Display a boolexp.
* This function returns the textual representation of the boolexp.
* \param player The object wanting the decompiled boolexp.
char *buftop = boolexp_buf;
unsigned char *bytecode = NULL;
+ unparsing_boolexp = 1;
+
if (b == TRUE_BOOLEXP)
safe_str("*UNLOCKED*", boolexp_buf, &buftop);
else {
}
done:
*buftop++ = '\0';
+ unparsing_boolexp = 0;
return boolexp_buf;
}
static lock_list *next_free_lock(void);
static void free_lock(lock_list *ll);
+extern int unparsing_boolexp;
+
/** Return a list of all available locks
* \param buff the buffer
* \param bp a pointer to the current position in the buffer
eval_lock(dbref player, dbref thing, lock_type ltype)
{
boolexp b = getlock(thing, ltype);
- log_activity(LA_LOCK, thing, unparse_boolexp(player, b, UB_DBREF));
- if(Pass_Lock(player, thing) && IS_passlock_type(ltype))
+ if(Pass_Lock(player, thing) && IS_passlock_type(ltype))
return 1;
+ /* Prevent overwriting a static buffer in unparse_boolexp() */
+ if (!unparsing_boolexp)
+ log_activity(LA_LOCK, thing, unparse_boolexp(player, b, UB_DBREF));
return eval_boolexp(player, getlock(thing, ltype), thing, NULL);
}