Jump to content
  • 0
Tio Akima

Reference variable (skill.c to Unit.c)

Question

Hello guys,
I'm using a command in skill.c to make a mob floor
I'm using unit-> walktoxy () inside a for ()
(It is in the file skill.c)

unit->walktoxy(&md->bl,sx,sy,0);

(Ie the mob, and where it goes)
Now I would like to display a message when this mob can not walk anymore.
I thought about putting a condition (IF) on unit_walktoxy

When it finds a non-walking cell, it displays the message.
I put this condition

 if ( map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKWALL) || map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKNOPASS)) {
                        printf("stop! \n");  // console message               
                                        break; //end
                                    }

This is the logic .. but it still is not working.

Because I need to get the mob reference (from skil.cl) and use this condition
I need to refer to the same mob

There in bl->m, bl, bl->x, bl->y


How can I do this?

 

 

 

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.