better use double wield and fix bugs

This commit is contained in:
Ondřej Novák 2025-02-04 20:21:13 +01:00
parent 33fa026576
commit ce3e42f66b
14 changed files with 199 additions and 81 deletions

View file

@ -530,7 +530,7 @@ const void *col_load(const void *data, int32_t *size)
#define Lo(x) ((x)& 0xffff)
char labyrinth_find_path(word start,word konec,int flag,char (*proc)(word),word **cesta)
char labyrinth_find_path(word start,word konec,int flag,char (*proc)(word, void *),word **cesta, void *ctx)
{
longint *stack;
longint *stk_free;
@ -553,7 +553,7 @@ char labyrinth_find_path(word start,word konec,int flag,char (*proc)(word),word
d=map_sectors[ss].step_next[i];
c=1<<(d & 0x7);
w=d>>3;
if (!(ok_flags[w] & c) && proc(d))
if (!(ok_flags[w] & c) && (proc==NULL || proc(d, ctx)))
{
ok_flags[w]|=c;
*stk_free++=d | ((stk_cur-stack)<<16);