Re: [CODE][BUG] Exploitable bug in do_flee/do_simple_move

From: Mike Breuer (mbreuer@new.rr.com)
Date: 09/29/01


----- Original Message -----
From: "George Greer" <greerga@CIRCLEMUD.ORG>


> Wouldn't people be happier with an "on_room_enter" event trigger?  I know
> mobile aggression would prefer that anyway.  Probably then go for
> "on_room_exit" to be consistent.  Maybe "on_item_get", "on_item_drop",
> "on_item_give", etc. Shouldn't take up much extra RAM since it'd be stored
> in the prototypes and not each object/mobile.  Calling convention would be
> SPECIAL() as usual, likely.

What I ended up doing is similar to what you are suggesting, but not quite
the same.  I modified all of my spec procs by adding a parameter that
indicates how the proc was triggered, and then in each SPECIAL I use a macro
to test/indicate which triggers the proc will handle.  So, I can put calls
to SPECIAL's in the char_to_room code (or wherever), and it would go ahead
and call procs for mobs, or items in inventory, or the room itself
regardless.  The procs themselves register an interest in the "on room
enter" trigger; those that are not interested return and do nothing.

I'm very happy with the solution, as it allows me to write SPECIAL's that
are triggered in new ways without having to go back and rework my existing
procs, and without having to store an extra function pointer in the various
prototypes.  I realize that there may already be snippets that work similar
to this (as some were kind enough to point out via direct email), but I
wanted to implement the solution myself for various reasons that I don't
really feel the need to enumerate here.

> A late reply, but check the date and you'll understand.

Understood.  In fact, one of the reasons I posted that day was that I was
having trouble focusing on work.  :-(

Mike

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST