Author Topic: add_action error  (Read 3407 times)

Offline Maze of Ith

  • Acquaintance
  • *
  • Posts: 33
  • Sometimes nothing can be a really cool hand.
    • View Profile
add_action error
« on: January 11, 2009, 02:34:36 PM »
The following code is in an object
Code: [Select]
int vortex() {
    this_player()->eventMove("/realms/ith/area/room/vortex");
}

and:
Code: [Select]
void init() {
::init();
add_action("vortex", "vortex");
}


The error is as follows:
Code: [Select]
*Illegal to move or destruct an object (/realms/ith/workroom) defining actions from a
verb function which returns zero.
Object: <none> (0) at /?\???`]???:1

Trace written to /log/runtime

/log/runtime:
Code: [Select]
2009.01.11-13.38,32
*Illegal to move or destruct an object (/realms/ith/workroom) defining actions from a
verb function which returns zero.
Object: <none> (0) at /?\???`]???:1
zed @ looney2.com 8888
zed <at> lilypadmudlib <dot> com

Offline Raudhrskal

  • BFF
  • ***
  • Posts: 214
  • The MUD community needs YOUR help!
    • View Profile
Re: add_action error
« Reply #1 on: January 11, 2009, 02:38:01 PM »
Bah.

Your add_action should return zero if it decided that it's not going to do anything, but 1 if it does.

So, add 'return 1;' below the eventMove.
I think, therefore i may be wrong.
Please note that if you met a Raudhrskal in a place that's not related to muds, it wasn't me. *sigh*... back when I started there was zero hits on google for that name...

Offline Maze of Ith

  • Acquaintance
  • *
  • Posts: 33
  • Sometimes nothing can be a really cool hand.
    • View Profile
Re: add_action error
« Reply #2 on: January 11, 2009, 02:41:09 PM »
It is almost the same error...

Code: [Select]
2009.01.11-13.44,35
*Function for verb 'arrest' not found.
Object: <none> (0) at /?\???`]???:1
« Last Edit: January 11, 2009, 02:45:19 PM by ith »
zed @ looney2.com 8888
zed <at> lilypadmudlib <dot> com

Offline Raudhrskal

  • BFF
  • ***
  • Posts: 214
  • The MUD community needs YOUR help!
    • View Profile
Re: add_action error
« Reply #3 on: January 11, 2009, 02:43:58 PM »
reply the mention of a verb is pretty much absurd here... something is seriously wrong. try 'update /daemon/verbs' and then retry.
Do you tried to do it using a verb file, but removed it later?


EDIT: intermud: supposedly file hasn't been updated, and works now.
I think, therefore i may be wrong.
Please note that if you met a Raudhrskal in a place that's not related to muds, it wasn't me. *sigh*... back when I started there was zero hits on google for that name...

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1020
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: add_action error
« Reply #4 on: January 11, 2009, 02:44:34 PM »
Quote
almost the exact same thing except there is a :1 instead of a :0:

Skal's assessment is correct. Please post the code to the object, if
there is still a problem.

Amusingly, this situation *used* to actually crash the driver! Now
it's just a reminder to make sure you return properly.

-Crat

Offline Maze of Ith

  • Acquaintance
  • *
  • Posts: 33
  • Sometimes nothing can be a really cool hand.
    • View Profile
Re: add_action error
« Reply #5 on: January 11, 2009, 02:46:28 PM »
He was right... That did do it. I actually just cloned the old object to test with instead of the one with the changes... Thanks Raudhrskal... And that error was better than crashing the driver... heh heh...

Thanks guys!
zed @ looney2.com 8888
zed <at> lilypadmudlib <dot> com