[DGD]shadowing

Risto Karjalainen risto.karjalainen at pp1.inet.fi
Sun Mar 12 22:41:29 CET 2000


Okay, thanks to your advices I have already overrided the call_other function
with great success but I still have one bloody problem.

Here's the shadow code:

private mapping shadows;

void shadow(object ob, object trg) {
 if(!shadows[trg]) {
  shadows+=([ trg: ({ ob }) ]);
 }
 else {
  shadows[trg]+=({ ob });
 }
}

object query_shadowing(object who, object whom) {
 int i;
 if(!shadows[whom]) return 0;
 i=member_array(who, shadows[whom]);
 if(i==-1) return 0;
 return shadows[whom][i];
}

object find_shadow_by_func(object trg, string func) {
 int i;
 object *shs;
 if(!shadows[trg]) return 0;   /* (*) THIS IS THE MARKED LINE!*/
 shs=shadows[trg];
 for(i=sizeof(shs);i--; ) {
  if(function_object(func, shs[i])) {
   return shs[i];
  }
 }
 return 0;
}


And here comes the call_other:

static varargs mixed call_other(mixed obj, string func, mixed args...) {
 object ob;
 rlimits(-1;-1) {
  if(objectp(obj)) ob=find_shadow_by_func(obj, func);
  if(ob) obj=ob;
  return ::call_other(obj, func, args...);
 }
}


Now it still don't work. I have an object with shadow(this_object(), trg_ob);
in it but it still won't work. It seems that the code can't get past the line marked
with (*), but to me, it seems that it SHOULD get over it when I have called
shadow...

I'm helpless, I've used all my tricks and tried some really interesting fixes
but none of them has worked. Please help a fellow in trouble ;)

Regards,
Risto Karjalainen

ps. The problem's prolly something too relevant, if so, you can call me stupid
      or what ever you wan't but PLEASE tell me where the problem is.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.dworkin.nl/pipermail/dgd/attachments/20000312/af03378d/attachment.html>


More information about the DGD mailing list