Author Topic: Error with class vs class  (Read 2478 times)

Offline Hansel

  • Acquaintance
  • *
  • Posts: 4
    • View Profile
Error with class vs class
« on: May 09, 2012, 01:09:43 AM »
Hey guys,

I know this forum isn't very active but I have a bit of a problem that I can't seem to figure out so I'm hoping someone is around that can lend an experienced ear. :)

I have shifted over to the Discworld distribution lib, and while everything has been going as smoothly as possible (most things have been fixable), I have run into an error with my magic handler.  It all works except for this part in the effect
the error is this:

. Bad assignment ( class  vs class
). before the end of line

which is this line here:
result = match_objects_in_environments(thing, caster);

this is for dealing with consuming items and required reagents.  I'm pretty stumped, so I do hope someone is around. :)


Offline drakkos

  • Acquaintance
  • *
  • Posts: 28
  • Work My Darkest Larks
    • View Profile
    • Epitaph Online
Re: Error with class vs class
« Reply #1 on: May 09, 2012, 01:50:48 AM »
It's a disambiguation problem - a class comes out of the function, but it's not sure which one.  Try:

result = (class obj_match) match_objects_in_environments(thing, caster);

Drakkos.
Epitaph Online - http://drakkos.co.uk

Offline Hansel

  • Acquaintance
  • *
  • Posts: 4
    • View Profile
Re: Error with class vs class
« Reply #2 on: May 09, 2012, 05:09:30 AM »
arrrgh that worked!

thank you so much... i had this at the top:

 class obj_match result;

so simple to fix, now i feel embarassed for posting :D

Offline Hansel

  • Acquaintance
  • *
  • Posts: 4
    • View Profile
Re: Error with class vs class
« Reply #3 on: May 09, 2012, 05:34:35 AM »
well actually i forgot about this one

void set_consumed(mapping cconsumed) {
 // if(!mappingp(cconsumed))
return;
  consumed = cconsumed;
} /* set_consumed() */

i have commented out mappingp because it errors as an undefined function.... how is this done in the discworld lib? :/


Offline drakkos

  • Acquaintance
  • *
  • Posts: 28
  • Work My Darkest Larks
    • View Profile
    • Epitaph Online
Re: Error with class vs class
« Reply #4 on: May 11, 2012, 10:56:46 AM »
Mappingp() should work, as should mapp () - what happens if you try it in an exec, such as:

exec mapping map = ([ ]);  return mappingp (map);

Drakkos
Epitaph Online - http://drakkos.co.uk

Offline wodan

  • BFF
  • ***
  • Posts: 434
  • Drink and code, you know you want to!
    • View Profile
Re: Error with class vs class
« Reply #5 on: May 11, 2012, 11:08:03 AM »
Yes, mappingp should work, as this line should be in /include/all_inc.h, is it?

#define mappingp(x) (mapp(x))

Offline Hansel

  • Acquaintance
  • *
  • Posts: 4
    • View Profile
Re: Error with class vs class
« Reply #6 on: May 11, 2012, 11:50:36 PM »
Yes, mappingp should work, as this line should be in /include/all_inc.h, is it?

#define mappingp(x) (mapp(x))

First thank you to both of you for replying, I appreciate that.

Drakkos, I did your exec and it errored as an undefined function.

Wodan, I don't have an /include/all_inc.h file for some reason, but I did just define the mapping in the effect file, it now loads and I tested it out on a spell and it worked without trouble.

Thank you both very much, it has alleviated much of my frustration and now I can continue doing the more enjoyable things (until the next time something breaks anyway!!).

Hans