Reference variable (skill.c to Unit.c)

Tio Akima

New member
Messages
349
Points
0
Age
36
Discord
TioAkima#0636
Github
Tio Akima
Emulator
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?

 
Back
Top