TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Unwanted behaviour in "#path walk backwards"?

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
stb



Joined: 16 Sep 2009
Posts: 3

PostPosted: Sun Sep 05, 2010 3:36 am    Post subject: Unwanted behaviour in "#path walk backwards"? Reply with quote

Related version(s): 1.9x.y and up ( currently using 2.00.4 beta )

Consider the following:
Code:

#path new
#PATH: YOU ARE NOW MAPPING A PATH.
e
s
#path map
#PATH:  e s
#path walk b
#path map
#PATH:  e
#path walk b
#path map
#PATH MAP: EMPTY PATH.
e
#path map
#PATH MAP: EMPTY PATH.


It seems that mapping is disabled when you reach the start room of your path. Is this intentional?

I made some changes to path.c to deal with this temporarily

Code:

DO_PATH(path_walk)
{
   int bit_mapping;  // for path walk workaround

   char left[BUFFER_SIZE];
   struct listroot *root;

   root = ses->list[LIST_PATH];

   arg = sub_arg_in_braces(ses, arg, left, GET_ONE, SUB_VAR|SUB_FUN);

   if (root->used == 0)
   {
      tintin_puts(ses, "#END OF PATH.");
   }
   else
   {
      bit_mapping = HAS_BIT(ses->flags, SES_FLAG_MAPPING); // for path walk workaround
      DEL_BIT(ses->flags, SES_FLAG_MAPPING);

      switch (tolower((int) *left))
      {
         case 'b':
            script_driver(ses, LIST_PATH, root->list[root->used - 1]->right);
            delete_index_list(ses->list[LIST_PATH], root->used - 1);
            break;

         case '\0':
         case 'f':
            script_driver(ses, LIST_PATH, root->list[0]->left);
            delete_index_list(ses->list[LIST_PATH], 0);
            break;

         default:
            tintin_printf(ses, "#SYNTAX: #WALK {FORWARD|BACKWARD}.");
            break;
      }
      if (root->used == 0)
      {
         check_all_events(ses, 0, 0, "END OF PATH");
      }
//HACKHACKHACKHACKHACKHACKHACKHACKHACKHACKHACKHACK
      if (bit_mapping) SET_BIT(ses->flags, SES_FLAG_MAPPING); // for path walk workaround
//HACKHACKHACKHACKHACKHACKHACKHACKHACKHACKHACKHACK         }
}


Any ideas for a more permanent fix ( code or script ) ?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Sun Sep 05, 2010 2:35 pm    Post subject: Reply with quote

Mapping is disabled (intentionally) the moment you use #path walk.

One work around is to resume mapping with the END OF PATH event.

#event {END OF PATH} {#path new}

The only real workaround for consistent walk back behavior is using the auto mapper, which allows you to undo the last 100 moves with #map undo.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group