Changeset 1226
- Timestamp:
- 03/07/08 02:14:27 (6 months ago)
- Files:
-
- 1.8.3/branches/devel/CHANGES.183 (modified) (1 diff)
- 1.8.3/branches/devel/game/txt/hlp/pennfunc.hlp (modified) (1 diff)
- 1.8.3/branches/devel/src/function.c (modified) (1 diff)
- 1.8.3/branches/devel/src/fundb.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/branches/devel/CHANGES.183
r1225 r1226 47 47 * controls(<who>,<what>/<attribute>) tests if someone can change or 48 48 create a specific attribute on an object. By Talvo. 49 * hasattr() and family also understand foo(<object>/<attribute>) in 50 addition to the traditional two-argument form. Suggested by Impster, 51 patch by Talvo. 49 52 50 53 Fixes: 1.8.3/branches/devel/game/txt/hlp/pennfunc.hlp
r1199 r1226 1638 1638 hasattrpval() is hasattrval() but checks parents. 1639 1639 1640 All four functions will also work with one argument in the form 1641 of <object>/<attribute>. 1642 1640 1643 & HASFLAG() 1641 1644 hasflag(<object>[/<attrib>], <flag name>) 1.8.3/branches/devel/src/function.c
r1183 r1226 438 438 {"GT", fun_gt, 2, 2, FN_REG}, 439 439 {"GTE", fun_gte, 2, 2, FN_REG}, 440 {"HASATTR", fun_hasattr, 2, 2, FN_REG},441 {"HASATTRP", fun_hasattr, 2, 2, FN_REG},442 {"HASATTRPVAL", fun_hasattr, 2, 2, FN_REG},443 {"HASATTRVAL", fun_hasattr, 2, 2, FN_REG},440 {"HASATTR", fun_hasattr, 1, 2, FN_REG}, 441 {"HASATTRP", fun_hasattr, 1, 2, FN_REG}, 442 {"HASATTRPVAL", fun_hasattr, 1, 2, FN_REG}, 443 {"HASATTRVAL", fun_hasattr, 1, 2, FN_REG}, 444 444 {"HASFLAG", fun_hasflag, 2, 2, FN_REG}, 445 445 {"HASPOWER", fun_haspower, 2, 2, FN_REG}, 1.8.3/branches/devel/src/fundb.c
r1199 r1226 198 198 { 199 199 dbref thing; 200 char *attr; 200 201 ATTR *a; 202 203 if (nargs == 1) { 204 attr = strchr(args[0], '/'); 205 if (!attr) { 206 safe_format(buff, bp, T("#-1 BAD ARGUMENT FORMAT TO %s"), called_as); 207 return; 208 } 209 *attr++ = '\0'; 210 } else { 211 attr = args[1]; 212 } 201 213 202 214 thing = match_thing(executor, args[0]); … … 206 218 } 207 219 if (strchr(called_as, 'P')) 208 a = atr_get(thing, upcasestr(a rgs[1]));209 else 210 a = atr_get_noparent(thing, upcasestr(a rgs[1]));220 a = atr_get(thing, upcasestr(attr)); 221 else 222 a = atr_get_noparent(thing, upcasestr(attr)); 211 223 if (a && Can_Read_Attr(executor, thing, a)) { 212 224 if (strchr(called_as, 'V'))
