| 1 | *** src/function.c.orig Fri Oct 5 23:36:32 2007 |
|---|
| 2 | --- src/function.c Tue Feb 5 04:16:00 2008 |
|---|
| 3 | *************** |
|---|
| 4 | *** 438,447 **** |
|---|
| 5 | {"GREPI", fun_grep, 3, 3, FN_REG}, |
|---|
| 6 | {"GT", fun_gt, 2, 2, FN_REG}, |
|---|
| 7 | {"GTE", fun_gte, 2, 2, FN_REG}, |
|---|
| 8 | ! {"HASATTR", fun_hasattr, 2, 2, FN_REG}, |
|---|
| 9 | ! {"HASATTRP", fun_hasattr, 2, 2, FN_REG}, |
|---|
| 10 | ! {"HASATTRPVAL", fun_hasattr, 2, 2, FN_REG}, |
|---|
| 11 | ! {"HASATTRVAL", fun_hasattr, 2, 2, FN_REG}, |
|---|
| 12 | {"HASFLAG", fun_hasflag, 2, 2, FN_REG}, |
|---|
| 13 | {"HASPOWER", fun_haspower, 2, 2, FN_REG}, |
|---|
| 14 | {"HASTYPE", fun_hastype, 2, 2, FN_REG}, |
|---|
| 15 | --- 438,447 ---- |
|---|
| 16 | {"GREPI", fun_grep, 3, 3, FN_REG}, |
|---|
| 17 | {"GT", fun_gt, 2, 2, FN_REG}, |
|---|
| 18 | {"GTE", fun_gte, 2, 2, FN_REG}, |
|---|
| 19 | ! {"HASATTR", fun_hasattr, 1, 2, FN_REG}, |
|---|
| 20 | ! {"HASATTRP", fun_hasattr, 1, 2, FN_REG}, |
|---|
| 21 | ! {"HASATTRPVAL", fun_hasattr, 1, 2, FN_REG}, |
|---|
| 22 | ! {"HASATTRVAL", fun_hasattr, 1, 2, FN_REG}, |
|---|
| 23 | {"HASFLAG", fun_hasflag, 2, 2, FN_REG}, |
|---|
| 24 | {"HASPOWER", fun_haspower, 2, 2, FN_REG}, |
|---|
| 25 | {"HASTYPE", fun_hastype, 2, 2, FN_REG}, |
|---|
| 26 | *** src/fundb.c.orig Mon Jul 9 04:50:12 2007 |
|---|
| 27 | --- src/fundb.c Tue Feb 5 04:20:51 2008 |
|---|
| 28 | *************** |
|---|
| 29 | *** 197,203 **** |
|---|
| 30 | --- 197,215 ---- |
|---|
| 31 | FUNCTION(fun_hasattr) |
|---|
| 32 | { |
|---|
| 33 | dbref thing; |
|---|
| 34 | + char *attr; |
|---|
| 35 | ATTR *a; |
|---|
| 36 | + |
|---|
| 37 | + if (nargs == 1) { |
|---|
| 38 | + attr = strchr(args[0], '/'); |
|---|
| 39 | + if (!attr) { |
|---|
| 40 | + safe_format(buff, bp, T("#-1 BAD ARGUMENT FORMAT TO %s"), called_as); |
|---|
| 41 | + return; |
|---|
| 42 | + } |
|---|
| 43 | + *attr++ = '\0'; |
|---|
| 44 | + } else { |
|---|
| 45 | + attr = args[1]; |
|---|
| 46 | + } |
|---|
| 47 | |
|---|
| 48 | thing = match_thing(executor, args[0]); |
|---|
| 49 | if (!GoodObject(thing)) { |
|---|
| 50 | *************** |
|---|
| 51 | *** 205,213 **** |
|---|
| 52 | return; |
|---|
| 53 | } |
|---|
| 54 | if (strchr(called_as, 'P')) |
|---|
| 55 | ! a = atr_get(thing, upcasestr(args[1])); |
|---|
| 56 | else |
|---|
| 57 | ! a = atr_get_noparent(thing, upcasestr(args[1])); |
|---|
| 58 | if (a && Can_Read_Attr(executor, thing, a)) { |
|---|
| 59 | if (strchr(called_as, 'V')) |
|---|
| 60 | safe_chr(*AL_STR(a) ? '1' : '0', buff, bp); |
|---|
| 61 | --- 217,225 ---- |
|---|
| 62 | return; |
|---|
| 63 | } |
|---|
| 64 | if (strchr(called_as, 'P')) |
|---|
| 65 | ! a = atr_get(thing, upcasestr(attr)); |
|---|
| 66 | else |
|---|
| 67 | ! a = atr_get_noparent(thing, upcasestr(attr)); |
|---|
| 68 | if (a && Can_Read_Attr(executor, thing, a)) { |
|---|
| 69 | if (strchr(called_as, 'V')) |
|---|
| 70 | safe_chr(*AL_STR(a) ? '1' : '0', buff, bp); |
|---|