Version 0.73p1 is a maintenance release of version 0.73.
It is the first maintenance release in that series.
+ Minor changes:
+ * General OOREF cleanup [AEJ]
+
Fixes:
* Fixed cstatus() [AEJ]
* Fixed bug that caused some lock types to incorrectly count
/* TwinCheck Ooref define */
#define OOREF(x,y,z) ((ooref == NOTHING || x == ooref) ? (y) : (z && y))
-#define BEGINOOREF_L char l = 0; \
- if(options.twinchecks && ooref == NOTHING ) { \
- ooref = executor; \
- l = 1; \
- }
-#define ENDOOREF_L if(l == 1) { ooref = NOTHING; }
+
+#define OOREF_DECL char __ooref_set = 0
+
+#define ENTER_OOREF if(options.twinchecks && ooref == NOTHING) { \
+ ooref = executor; \
+ __ooref_set = 1; \
+ }
+
+#define LEAVE_OOREF if(__ooref_set) { \
+ ooref = NOTHING; \
+ __ooref_set = 0; \
+ }
/* New Guest Setup Configuration */
#define GUEST_KEYWORD "GUEST"
char *say_string;
char *string;
char rbuff[BUFFER_LEN];
-
- BEGINOOREF_L
+ OOREF_DECL;
speaker = match_thing(executor, args[0]);
if (speaker == NOTHING || speaker == AMBIGUOUS) {
safe_str(T(e_match), buff, bp);
- ENDOOREF_L
return;
}
+
speaker_str = unparse_dbref(speaker);
- if (!args[1] || !*args[1]) {
- ENDOOREF_L
+ if (!args[1] || !*args[1])
return;
- }
string = args[1];
else
say_string = (char *) "says,";
+ ENTER_OOREF;
+
if (nargs > 3) {
if (args[3] != '\0') {
/* we have a transform attr */
transform = 1;
if (!fetch_ufun_attrib(args[3], executor, &transufun, 1)) {
- ENDOOREF_L
safe_str(T(e_atrperm), buff, bp);
+ LEAVE_OOREF;
return;
}
if (nargs > 4) {
/* we have an attr to use when transform returns an empty string */
null = 1;
if (!fetch_ufun_attrib(args[4], executor, &nullufun, 1)) {
- ENDOOREF_L
safe_str(T(e_atrperm), buff, bp);
+ LEAVE_OOREF;
return;
}
}
safe_format(buff, bp, "%s %s \"%s\"", Name(speaker), say_string, string);
else
safe_str(string, buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
wenv[1] = speaker_str;
wenv[2] = unparse_integer(fragment);
if (call_ufun(&transufun, wenv, 3, rbuff, executor, enactor, pe_info)) {
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
if (strlen(rbuff) > 0) {
safe_format(buff, bp, "%s %s %s", Name(speaker), say_string, rbuff);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
} else if (null == 1) {
wenv[0] = speaker_str;
wenv[1] = unparse_integer(fragment);
if (call_ufun(&nullufun, wenv, 2, rbuff, executor, enactor, pe_info)) {
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
safe_str(rbuff, buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
} else {
safe_str(string, buff, bp); /* remaining string (not speech, so not t) */
}
}
- ENDOOREF_L
+
+ LEAVE_OOREF;
}
char *s;
char const *p;
dbref obj;
+ OOREF_DECL;
- BEGINOOREF_L
+ ENTER_OOREF;
/* First, we evaluate our first argument so people can use
* functions on it.
p = args[1];
process_expression(buff, bp, &p, obj, executor, enactor, PE_DEFAULT,
PT_DEFAULT, pe_info);
- ENDOOREF_L
+
+ LEAVE_OOREF;
}
/** Helper function for ufun and family.
{
char rbuff[BUFFER_LEN];
ufun_attrib ufun;
+ OOREF_DECL;
- BEGINOOREF_L
+ ENTER_OOREF;
if (!fetch_ufun_attrib(args[0], executor, &ufun, 0)) {
safe_str(T(ufun.errmess), buff, bp);
+ LEAVE_OOREF;
return;
}
safe_str(rbuff, buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
{
char rbuff[BUFFER_LEN];
ufun_attrib ufun;
+ OOREF_DECL;
- BEGINOOREF_L
+ ENTER_OOREF;
if (!fetch_ufun_attrib(args[0], executor, &ufun, 1)) {
safe_str(T(ufun.errmess), buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
safe_str(rbuff, buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
+
return;
}
char *preserve[NUMQ];
char rbuff[BUFFER_LEN];
ufun_attrib ufun;
+ OOREF_DECL;
- BEGINOOREF_L
+ ENTER_OOREF;
if (!fetch_ufun_attrib(args[0], executor, &ufun, 0)) {
safe_str(T(ufun.errmess), buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
restore_global_regs("ulocal.save", preserve);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
char **xargs;
int i;
char *preserve[NUMQ];
+ OOREF_DECL;
- BEGINOOREF_L
+ ENTER_OOREF;
/* find our object and attribute */
dp = mstr;
mush_free(xargs[i], "udefault");
mush_free(xargs, "udefault.xargs");
}
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
/* We couldn't get it. Evaluate args[1] and return it */
PE_DEFAULT, PT_DEFAULT, pe_info);
if (called_as[1] == 'L')
restore_global_regs("uldefault.save", preserve);
- ENDOOREF_L
+
+ LEAVE_OOREF;
+
return;
}
{
ATTR *attrib;
dbref zone;
+ OOREF_DECL;
- BEGINOOREF_L
+ ENTER_OOREF;
zone = Zone(executor);
if (zone == NOTHING) {
safe_str(T("#-1 INVALID ZONE"), buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
/* find the user function attribute */
if (attrib && Can_Read_Attr(executor, zone, attrib)) {
if (!CanEvalAttr(executor, zone, attrib)) {
safe_str(T(e_perm), buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
do_userfn(buff, bp, zone, attrib, nargs - 1, args + 1, executor, caller,
enactor, pe_info);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
} else if (attrib || !Can_Examine(executor, zone)) {
safe_str(T(e_atrperm), buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}
safe_str(T("#-1 NO SUCH USER FUNCTION"), buff, bp);
- ENDOOREF_L
+ LEAVE_OOREF;
return;
}