Jump to content
Eternal Lands Official Forums
Sign in to follow this  
The_Piper

#goto X,y Patch

Recommended Posts

Hi ppl,

 

i have made a small patch which implements a command named #goto x,y.

 

So you can type #goto 25,15 to go to the coordinates 25,15 on your actual map.

 

This patch goes to multiplayer.c. Right behind

 

case RAW_TEXT:

{

#ifdef GOTOPATCH                                             /* GOTO PATCH */
     int gtx, gty;                              /* GOTO PATCH */
     char zwi[64];                              /* GOTO PATCH */
     char zwi2[64];                             /* GOTO PATCH */
     sprintf(zwi, "%s: ", username_str);        /* GOTO PATCH */
                                                                        if(strncmp(&in_data[4],zwi,strlen(zwi))==0){/* GOTO PATCH */
    	 strncpy(zwi2,                           /* GOTO PATCH */
         &in_data[4+strlen(username_str)+3],  /* GOTO PATCH */
       data_lenght-4-strlen(username_str)-3);/* GOTO PATCH */
                    if(strncmp(zwi2, "#goto ", 6)==0){      /* GOTO PATCH */
           sprintf(zwi,"#goto %%d,%%d");        /* GOTO PATCH */
         sscanf(zwi2, zwi, &gtx, &gty);       /* GOTO PATCH */
         if(gtx>0 && gty>0){                  /* GOTO PATCH */
          	 if(pf_find_path(gtx, gty)>0){     /* GOTO PATCH */
               sprintf(zwi,                   /* GOTO PATCH */
               "Going to %d,%d", gtx,gty);    /* GOTO PATCH */
               log_to_console(c_green1,zwi);  /* GOTO PATCH */
            }                                 /* GOTO PATCH */
            else{                             /* GOTO PATCH */
               strcpy(zwi,"You cant go there!");/* GOTO PATCH */
               log_to_console(c_red1,zwi);    /* GOTO PATCH */
            }                                 /* GOTO PATCH */
         }                                    /* GOTO PATCH */
       data_lenght=0;                       /* GOTO PATCH */
       memset(in_data, 0, sizeof(in_data)); /* GOTO PATCH */
       break;                               /* GOTO PATCH */
    	 }                                       /* GOTO PATCH */
     }                                          /* GOTO PATCH */
# endif                                                      /* GOTO PATCH */

 

Piper

Share this post


Link to post
Share on other sites

Well, Fred..

 

this patch is really useful if you know where you died. If youve got the coordinates, it brings you right back to your bag.

 

So always click on the compass before attacking this nasty gobbie or use a death message patch ;-)

 

Piper

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×