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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

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